Various win32 / vs build fixes