Fix bug with unsigned char