fix some bugs on windows