   def calc_rule_periods([zone_line|zone_line_tl], from, utc_off, std_off, years, _, letter) when years==[] do
     from_standard_time = standard_time_from_utc(from, utc_off)
     from_wall_time = wall_time_from_utc(from, utc_off, std_off)
-    until_utc = datetime_to_utc(zone_line[:until], utc_off, std_off)
+    until_utc = datetime_to_utc(Map.get(zone_line, :until), utc_off, std_off)
     until_standard_time = standard_time_from_utc(until_utc, utc_off)
     until_wall_time = wall_time_from_utc(until_utc, utc_off, std_off)
     period =

        utc_off: utc_off,
        from: %{utc: from, wall: from_wall_time, standard: from_standard_time},
        until: %{standard: until_standard_time, wall: until_wall_time, utc: until_utc},
        zone_abbr: TzUtil.period_abbrevation(zone_line[:format], std_off, letter)
      }

      # Some times this will calculate periods with zero length.
      # Set period to nil if the length is zero (ie. "until" equals "from")
      # Nil values will be filtered by another function
      if period[:until][:utc] == period[:from][:utc], do: period = nil
      # If there are more rules for the year, continue with those rules
      if length(rules_tail) > 0 do
        [period|
         calc_periods_for_year([zone_line|zone_line_tl], until_utc, utc_off, rule[:save], years, zone_rules, rules_tail, rule[:letter])
        ]
      # Else continue with the next zone line
      else
        [period |
         calc_rule_periods([zone_line|zone_line_tl], until_utc, utc_off, rule[:save], years|>tl, zone_rules, rule[:letter])
        ]
      end
  end

        utc_off: utc_off,
        from: %{utc: from, wall: from_wall_time, standard: from_standard_time},
        until: %{standard: until_standard_time, wall: until_wall_time, utc: until_utc},
        zone_abbr: zone_line_hd.format
      }
    h_calc_periods_no_rules(period, until_utc, zone_line_tl, letter)
  end

  def calc_periods([zone_line_hd|zone_line_tl], from, zone_hd_rules, letter) do
    std_off = 0 # we start out by assuming there is no offset. the rules might change this
    utc_off = zone_line_hd.gmtoff
    from_standard_time = standard_time_from_utc(from, utc_off)
    zone_has_until_limit = Map.get(zone_line_hd, :until) != nil

    # Get the year of the "from" time. We use the standard time with utc offset
    # applied. If for instance we are ahead of UTC and the period starts at the
