         }
 
         public var dictionaryRepresentation: [String: Any] {
-            return [
+            var rval: [String: Any] = [
                 "dia": dia.hours,
                 "carbs_hr": "0",
                 "delay": "0",

            self.basal = basalRaw.compactMap { ScheduleItem(rawValue: $0) }
            self.targetLow = targetLowRaw.compactMap { ScheduleItem(rawValue: $0) }
            self.targetHigh = targetHighRaw.compactMap { ScheduleItem(rawValue: $0) }
            self.units = nil
         }
    }
    

                "basal": basal.map { $0.dictionaryRepresentation },
                "carbratio": carbratio.map { $0.dictionaryRepresentation },
                ]
            rval["units"] = units
            return rval
        }

        init?(rawValue: RawValue) {
