Improve error messages for association primary keys

Closes #66.