Sort list, not names of gems for #918

Sorting the list of names gives incorrect results as the order of the
gems in the displayed list and the order of the gems are not the same.

By sorting the list everything will work again.