Fixed GetPrimaryKey implementation