Fix for many-to-many relationships

Closes #37
Merge pull request #38 from dockyard/bc-37-inverse-fix

Fix for many-to-many relationships