Autogeneration of PrimaryKeyConstraint, fix undefined var typo