Compilation fixes for windows