fix compiler warnings

this still requires "-Wno-char-subscripts" when compiled with "-Wall"