Sort ambiguous matches.