anchor.diff:                      match span.[i + 4] with
                       | Entry.Empty -> None
                       | Entry.String str -> Some <| GroupEnd str
  -                    | e -> failwithf "Cannot retrieve group end for %s. Got %A." name e
  +                    | e -> invalidEGTf "Cannot retrieve group end for %s. Got %A." name e
                   let advanceMode =
  -                    match span.[i + 5] with
  -                    | Entry.Byte 'T'B -> AdvanceMode.Token
  -                    | Entry.Byte 'C'B -> AdvanceMode.Character
  -                    | e -> failwithf "Cannot retrieve group advance mode for %s. Got %A." name e
  +                    match wantByte span (i + 5) with
  +                    | 'T'B -> AdvanceMode.Token
  +                    | 'C'B -> AdvanceMode.Character
  +                    | x -> invalidEGTf "Cannot retrieve group advance mode for %s. Got %x." name x
                   let endingMode =
  -                    match span.[i + 6] with
  -                    | Entry.Byte 'O'B -> EndingMode.Open
  -                    | Entry.Byte 'C'B -> EndingMode.Closed
  -                    | e -> failwithf "Cannot retrieve group ending mode for %s. Got %A." name e
  +                    match wantByte span (i + 6) with
  +                    | 'O'B -> EndingMode.Open
  +                    | 'C'B -> EndingMode.Closed
  +                    | x -> invalidEGTf "Cannot retrieve group ending mode for %s. Got %x." name x
  +                let nestingCount = wantUInt32 span (i + 7) |> int
  +                i <- i + 8
  +
                   let nesting =
  -                    let nestingCount = wantUInt32 span (i + 7) |> int
                       let nesting = ImmutableHashSet.CreateBuilder()
  -                    for j = 0 to nestingCount - 1 do
  -                        nesting.Add(wantUInt32 span (i + 8 + j)) |> ignore
  +                    let span = span.Slice(i)
  +                    for i = 0 to span.Length - 1 do
  +                        nesting.Add(wantUInt32 span i) |> ignore
                       nesting.ToImmutable()
   
                   groups.Add {
  
positive.code:                     EndingMode = endingMode
                      Nesting = nesting
                  }
                  i <- i + 8 + nesting.Count
  
              groups.MoveToImmutable()
  
  /// Functions to write a grammar to EGTneo files.
  module EGTNeoWriter =
  
      open EGTWriter
  
      module private Implementation =
  
  
negative.code: 
              for i = 0 to groups.Length - 1 do
                  let group = groups.[i]
  
                  arr.Add <| Entry.String group.Name
                  arr.Add <| Entry.Boolean group.IsTerminal
                  arr.Add <|
  