correction of bug in the asTerm method