CORE-4207: corrected a problem with the way that tree labels are obtained