Handle primary keys other than "id" (fixes #29)