win32 compatibility fixes