Fix windows compile errors in generated code