Fix some problems under windows