Fix bug caused by treating term as an expression