Fixed some MSVC specific warnings

Fixed some MSVC specific warnings about narrowing conversions.