some further fixes to TreeView code