fixed some win32 bugs