Fix data type uint16_t for sum and average