Fix for #164 - Incorrect join used when where expression has a many
property and ends with a foreign key column