Further fixes for generator