Fix sorting of public data

Fix where the sort happens and do a secondary sort on sequence
number.