fix compiler warnings truncating integer values found with MSVC