Fixing the removal of relationships when identitytypes are removed.