Fixed removing entity causing adding of referenced entitied