Fix some issues on windows