Fix attributes sorting.