Make prefixBuffer an array of unsigned chars, or the conversion to integer blows up.