Sorting and select list bug fixes