Some bugs in windows fixed