Improved support for primary keys.