Fix identity message sorting