Windows compatibility

Also compiles correctly under windows.