Fixed #5335 -- Changed ErrorDict to be a subclass of defaultdict.