Fixed failing test due to sort order on linux

It turns out that given two identical values, perl on OSX will always
sort them in the same order, but linux does not. This meant that the
letter height order could be different between different runs of the
code.

In order to fix this I moved the sprintf that was reducing the
specificity to after the sort and added a second alphabetical sort
for the rare cases where the 9 digit numbers were still the same. This
should remove any possible ambiguity from the results.