Windows commandline compatibility

Few changes to make it compatible with the windows commandline and Gow.
Not yet tested if it still works on Linux