some fixes for Win32 MSVC