Sorting by extension bugfix