Bug fix in relationships (infinite loop)