Making tree collection wrapper work properly