Fix some issues on Windows