Generator, bugfixes