Fix sorting bug in listing
Emacs mode didn't work well