Fix getting primary keys of table, Model tests now pass