After sort the grades with something, everytime change the groups, I must click the sort link again, ..........So, I made this little patch:
diff -r1.16.2.12 lib.php
134a135
> global $group;
2811c2820
< $url = 'index.php?id='.$course->id;
---
> $url = 'index.php?id='.$course->id.'&sort='.optional_param('sort','default');