Fixed bug#7201 and made general code improvements to tree selection feature.
Fixed bug#7201 and made general code improvements to tree selection feature.