Merge pull request #172 from pedroigor/master

Fixing id-based queries for relationships. Added more test cases.