                     }
                     
                     try deletion(orphans).forEach {
-                        try map.key.mapping.delete(obj: $0)
+                        try binding.key.mapping.delete(obj: $0)
                     }
                 }
             }
         }
     }
     catch let error as NSError {
-        map.context.error = error
-    }
-    
-    return map.context
+        binding.context.error = error
+    }
+    
+    return binding.context
 }
 
 // Gets all newly mapped data and returns it in an array, caller can decide to append and what-not.

// MARK: - RangeReplaceableCollectionType (Array and Realm List follow this protocol).

@discardableResult
public func <- <T, U: Mapping, C: MappingContext>(field: inout U.SequenceKind, map:(key: Binding<U>, context: C)) -> C where U.MappedObject == T, U.SequenceKind: RangeReplaceableCollection, U.SequenceKind.Iterator.Element == U.MappedObject, T: Equatable {
    
    return mapFromJson(toCollection: &field, map: map)
}

private func map<T, U: Mapping, V: Sequence>(
    to json: JSONValue,
    fromField field: V,
    viaKey key: Keypath,
    mapping: U)
    throws -> JSONValue
    where U.MappedObject == T, V.Iterator.Element == T, U.SequenceKind.Iterator.Element == U.MappedObject {
        

}

@discardableResult
public func map<T, U: Mapping, C: MappingContext>(toCollection field: inout U.SequenceKind, using binding:(key: Binding<U>, context: C)) -> C where U.MappedObject == T, U.SequenceKind: RangeReplaceableCollection, U.SequenceKind.Iterator.Element == U.MappedObject, T: Equatable {
    
    do {
        switch binding.context.dir {
        case .toJSON:
            let json = binding.context.json
            try binding.context.json = Crust.map(to: json, from: field, via: binding.key, using: binding.key.mapping)
            
        case .fromJSON:
            let fieldCopy = field
            let (newObjects, _) = try mapFromJsonToSequence(map: binding) {
                fieldCopy.contains($0)
            }
            
            switch binding.key.collectionUpdatePolicy.insert {
            case .append:
                field.append(contentsOf: newObjects)
                
