Fix issue with sum over subsets