msvc build fixes. explicit casts required.
Merge pull request #656 from jossgray/msvc_build_fixes

msvc build fixes. explicit casts required.