MSVC compatibility fixes.

11 files changed