Corrected some problem on Windows

See comments in code