Qt5 MSVC build fixes

A few select fixes to make building against Qt5 possible with MSVC.