Fix compilation errors in generated code