Fix compile errors in generated code