Some modifications to aggregator.py