added debugging messages to getCharID().