Fixes simplification of more than two summations