Compatibility with Windows

Changed some lines of code to run on Windows.