another bunch of win32 bugfixes