Fixes for compilation on windows