Now using uint8_t instead of uchar, for correctness