Fixed sorting of matches.