fix bugs on Windows