Necessary fixes to compile generated code on Windows