Fix for MSVC warning

MSVC warning C4244: conversion from 'uint32_t' to 'uint16_t', possible
loss of data.
NOTE: this could also be fixed by appending & 0xFFFF after the function
call.