Fix a few warnings and compilation issues with MSVC.