Fix to_dict.