Fixed a bug when disconnecting a gen. relationship which has special
primary key.