windows fixes (untested on mac)