Change instance? calls
Fix some tokenizer bugs
Add a term-handling function