Fixing bugs in string for generated code