type check of relations
Add @throws fo dock block function signature
Merge pull request #2734 from anlutro-pull-requests/relationship-type-check

Type check of relations
Tweaking some code.
Use proper instance of Relation

Bugfix from @anlutro's recent PR #2734