Collect/Sort/SortBy/Length nested optimizations
Nested GroupBy implementation and bug fix.