Missings an items() invocation in the to_dict function