Bugfixes on relation updating