Fix log sort order