Bugfixed group sorting.