various small fixes to generator