adding removeChars to TermBuffer; fixing deadlock