Fixing the generator as discuss in the testing meeting.
Merge pull request #337 from mithro/fixing-generator

Fixing generator, third attempt.