Added an explicit int16_t cast in the read byte function