Change sorting order (fix #618)