Improved the polymorphic tree operations.