Fixed bugs under Windows