Fix sorting and adjust main term bounds.