Fixes setting of primary key on instances after creation #191