Fixed code for unix

I forgot to hide all the windows-specific stuff behind ifdefs