Fixed bugs in aggregator, TODO: some files still not being aggregated, add logging