anchor.diff:      override _.Length = length
   
       override _.ReadUtf8String(pos, count) =
  -        check pos
  -        check (pos + count - 1)
  -        System.Text.Encoding.UTF8.GetString(NativePtr.add addr pos, count)
  -
  -    override _.ReadBytes(pos, count) =
  -        check pos
  -        check (pos + count - 1)
  -        let res = Bytes.zeroCreate count
  -        Marshal.Copy(NativePtr.toNativeInt addr + nativeint pos, res, 0, count)
  -        res
  +        checkCount count
  +        if count > 0 then
  +            check pos
  +            check (pos + count - 1)
  +            System.Text.Encoding.UTF8.GetString(NativePtr.add addr pos, count)
  +        else
  +            String.Empty
  +
  +    override _.ReadBytes(pos, count) = 
  +        checkCount count
  +        if count > 0 then
  +            check pos
  +            check (pos + count - 1)
  +            let res = Bytes.zeroCreate count
  +            Marshal.Copy(NativePtr.toNativeInt addr + nativeint pos, res, 0, count)
  +            res
  +        else
  +            Array.empty
   
       override _.ReadInt32 pos =
           check pos
  
positive.code:         uint16(Marshal.ReadInt16(NativePtr.toNativeInt addr + nativeint pos))
  
      override _.Slice(pos, count) =
          check pos
          check (pos + count - 1)
          RawByteMemory(NativePtr.add addr pos, count, holder) :> ByteMemory
  
      override x.CopyTo stream =
          use stream2 = x.AsStream()
          stream2.CopyTo stream
  
      override _.Copy(srcOffset, dest, destOffset, count) =
          check srcOffset
          Marshal.Copy(NativePtr.toNativeInt addr + nativeint srcOffset, dest, destOffset, count)
  
      override _.ToArray() =
          let res = Array.zeroCreate<byte> length
          Marshal.Copy(NativePtr.toNativeInt addr, res, 0, res.Length)
          res
  
      override _.AsStream() =
          new SafeUnmanagedMemoryStream(addr, int64 length, holder) :> Stream
  
      override _.AsReadOnlyStream() =
          new SafeUnmanagedMemoryStream(addr, int64 length, int64 length, FileAccess.Read, holder) :> Stream            
  
  [<Struct;NoEquality;NoComparison>]
  type ReadOnlyByteMemory(bytes: ByteMemory) =
  
negative.code:     let check i =
          if i < 0 || i >= length then 
              raise (ArgumentOutOfRangeException("i"))
  
      let checkCount count =
          if count < 0 then
              raise (ArgumentOutOfRangeException("count", "Count is less than zero."))
  
      do
          if length < 0 then
  