Adds missing PK check back into model.php and fixes minor typos