Fixed bugs on Windows