Grab team names in query. Fix sorting.