Improve support for using accessors on primary keys