Fix uint8_t and int8_t conversion bugs