Fix code generation under Windows (and OS X?)