Added casting to uint16_t