Fix bug in tree view