Fixed nterms bug