Convert defaultdict to dict before returning.