Small changes to tree selection listener