Use proper instance of Relation

Bugfix from @anlutro's recent PR #2734
Merge pull request #2771 from adamgoose/master

Use proper instance of Relation