Fix error on update with same primary key name
Add tests for primary key update