Fixes tree selection.