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