Supporting perf.py on Windows and some small corrections in it