Fixed bug in term