MSVC compiler error and warning fixes.