Adding primary_key() getter method. Fixing a bug.