Applied a small optimization in the conversion of integer to Uint8