changed clone(Term[]) to return Term rather than CompoundTerm to allow certain Term types to return atomic values under certain conditions