added additional error checks to prevent users from applying functions for discrete operations on trees to
tree sets that just contain a single tree.