Fix for getting model primary key.