some bugfixes in the generator