Fixed some MSVC compilation issues