bugfixes for for defaultdict support