Did not work for pk===0, so comparing to null

Comparing to null (and not testing !isNaN because some pk may be strings).

Other files may require a similar change (I am using this plugin through a framework [Yii] where this code appears multiple times).