Added type casts (signed/unsigned char) to make GCC 4 happy