anchor.diff:          let name = m.Groups.["name"].Value.TrimEnd()
           let typeAndUnit = m.Groups.["type"].Value.Trim()
           let typ, unit = parseTypeAndUnit typeAndUnit
  -        if forSchemaOverride && typ.IsNone then
  -          failwithf "Invalid type: %s" typeAndUnit
  -        name, typ, unit, false
  +        name, typ, unit, false, ""
         elif forSchemaOverride then
           // type|type<measure>
           let typ, unit = parseTypeAndUnit str
           match typ, unit with
  -        | None, _ -> str, None, None, false
  -        | typ, unit -> "", typ, unit, false
  +        | None, _ -> str, None, None, false, ""
  +        | typ, unit -> "", typ, unit, false, ""
         else
           // name
  -        str, None, None, false
  +        str, None, None, false, ""
   
     match typ, unit with
     | Some (typ, typWrapper), unit ->
  -      PrimitiveInferedProperty.Create(name, typ, typWrapper, ?unit=unit)
  -      |> (if isOverride then SchemaParseResult.FullByName else SchemaParseResult.Full)
  +      let prop = PrimitiveInferedProperty.Create(name, typ, typWrapper, ?unit=unit)
  +      if isOverrideByName then 
  +        SchemaParseResult.FullByName(prop, originalName) 
  +      else 
  +      SchemaParseResult.Full prop
  +  | None, None when isOverrideByName -> SchemaParseResult.Rename(name, originalName)
  +  | None, None -> SchemaParseResult.Name str
  +  | None, Some unit when forSchemaOverride -> SchemaParseResult.Name str
     | None, Some unit -> SchemaParseResult.NameAndUnit(name, unit)
  -  | None, None -> SchemaParseResult.Name
   
   /// Infers the type of a CSV file using the specified number of rows
   /// (This handles units in the same way as the original MiniCSV provider)
  
positive.code: /// (if we succeed we override the inferred schema, otherwise, we just
  /// override the header name)
  let private parseSchemaItem str forSchemaOverride =     
    let name, typ, unit, isOverride = 
      let m = overrideByNameRegex.Match str
      if m.Success && forSchemaOverride then
        // name=type|type<measure>
        let name = m.Groups.["name"].Value.TrimEnd()
        let typeAndUnit = m.Groups.["type"].Value.Trim()
        let typ, unit = parseTypeAndUnit typeAndUnit
        if typ.IsNone then
          failwithf "Invalid type: %s" typeAndUnit
        name, typ, unit, true
      else
        let m = nameAndTypeRegex.Match(str)
        if m.Success then
  
negative.code:         | item -> 
              let parseResult = parseSchemaItem item true
              match parseResult with
              | SchemaParseResult.Name name ->
                  headers.[index] <- name
              | SchemaParseResult.Full prop -> 
                  let name = 
                    if prop.Name = "" then headers.[index]
                    else prop.Name
                  schema.[index] <- Some { prop with Name = makeUnique name }
              | SchemaParseResult.Rename (name, originalName) ->
                  let index = headers |> Array.tryFindIndex (fun header -> header.Equals(originalName, StringComparison.OrdinalIgnoreCase))
                  match index with
                  | Some index -> 
                      headers.[index] <- name
                  | None -> failwithf "Column '%s' not found in '%s'" originalName (headers |> String.concat ",")
              | SchemaParseResult.FullByName (prop, originalName) -> 
                  let index = headers |> Array.tryFindIndex (fun header -> header.Equals(originalName, StringComparison.OrdinalIgnoreCase))
                  match index with
                  | Some index -> 
                      let name = 
                        if prop.Name = "" then headers.[index]
                        else prop.Name
                      schema.[index] <- Some { prop with Name = makeUnique name }
                  | None -> failwithf "Column '%s' not found in '%s'" originalName (headers |> String.concat ",")
              | _ -> failwithf "inferType: Unexpected SchemaParseResult for schema: %A" parseResult
        schema
  
  