Fix defaultdict in task