Fix sortGroup