Fix determining primary keys of table, now all Model tests pass