Fix sorting in the table