[Fix Bug 880016] Don't pass empty string to group sort in a cleaner way.