Fix some errors and enhance usabilty under windows

Hi nroets,

I just created a branch of your script, the changes are untested, but I think its easy to fix some errors might in there.

Greetings Bürste