Updates to sort, reference codes, treeview.