Fix defaultdict usage