Fix message sorting order