Fix a bug where bounds checking cause a build failure on platforms with unsigned char.