Sort order fix; code restyle