fix several test cases run under windows
merge with the test case fixes in master