various win32 fixes