Order of join clause with alias join and select can lead to invalid configurations
Thanks for sharing some code to reproduce this!
 Basically what peewee is trying to figure out is how to patch the joined instance (`PersonAlias`, which is actually a `Person`) onto `RelatesToPerson` given the join predicate. There's some special-casing around aliases and expressions -- I think there are some undiscovered bugs in the relevant block of code. I'm working on a complete refactor to hopefully clean this up and make the behavior more predictable.
 I've got things partially fixed in 55373892a7454052c54a5b8bc9ba7d9da72aeeb2
 I believe this is now fixed.

I'm not sure how to describe the problem accurately, so here is a repro case:

``` python
from peewee import Model, SqliteDatabase, CharField, ForeignKeyField, create_model_tables

db = SqliteDatabase(':memory:')

class Person(Model):
    name = CharField(default='aperson')
    class Meta:
        database = db

class RelatesToPerson(Model):
    name = CharField(default='arelationship')
    person = ForeignKeyField(Person)
    class Meta:
        database = db

create_model_tables([Person, RelatesToPerson])

PersonAlias = Person.alias()

a_person = Person.create()
RelatesToPerson.create(person=a_person)

print str(RelatesToPerson
          .select(RelatesToPerson, PersonAlias)
          .join(PersonAlias, on=(PersonAlias.id == RelatesToPerson.person))
          .get().id) + " <- an instance!"

print (RelatesToPerson
       .select(RelatesToPerson, PersonAlias)
       .join(PersonAlias, on=(RelatesToPerson.person == PersonAlias.id))
       .get().id)
```

output

``` bash
$ python repro.py
<__main__.Person object at 0x10b201c50> <- an instance!
1
```
