Preventing from dirtying internals while creating a record with an existing id

[Fixes #768]