Fixed generator logic, improved Guard
Merge pull request #20 from nhr/generator_improvements

Fixed generator logic, improved Guard