Added changes to enable compiling on Windows (most likely not sufficient)