Revert "Revert "More Win32 build fixes""