Fix a bug with treeview trailing slash