Add error checking for getChar.