fix code generator errors (for good)