Fix bug collecting primary key properties