fix some bugs under the windows platform