Bugfix: when querying a reverse association, one of the two columns in the 'JOIN...ON' clause was not the right one (fixes #446)