[WIP] Changes for a different generator and some bugfixes