Added an option to limit depth in treeview.