Fix Warnings with MSVC 2012

The warning is:

`C4244: '=' : conversion from '__int64' to 'uint16_t', possible loss of data`