Merge "Fix several MSVC compiler warning/errors" into nextgenv2