Bug fix for issue #59 - Relationship deletion rules not being followed correctly. Also added a unit test for the problem.