Fixed bug when using accessors as primary key