Fix of sorting/formatting problem