Reimplemented function apply_term