Make sure that the merged object is used

The merged object will include the new primary keys
for new entities in relations.