Changed attrgetter to itemgetter for plan_to_dict()