Windowscompat

Added some code to make this work on windows too.