This prevents passing a negative value out of a signed char by accident. Also renders some casts in the code superfluous.