Fix aggregateinternal migration so it skips expired entries, and deletes output