Fix warning about type conversion
C has a feature where if you perform arithmetic on small integers (like char and short), it will automatically promote the result to a 32 bit integer. If you then store that back in the same type you started with GCC will warn you that you are loosing the precision (that you didn't ask for in the first place). This is particularly annoying in templated code.
Anyway, fixed yet another instance of that happening.