Some fixes to RepeatedPatternAggregator