Changed the push and pop toggle condition which minRegisterRequired is needed only.
Merge pull request #18 from jwchong93/master

Fixed a small bug on the generator