fixes for compilation on windows