Added windows workarounds

Please test on linux before merging ;)