Fixed code generator errors