Fix to_dict property deprecation.