Change primary keys to fix update error and better primary key management