             let childIDs = (children as NSArray).valueForKey(entity.sync_remotePrimaryKey())
 
             if childIDs is NSNull {
-                if let _ = valueForKey(relationship.name) {
+                if valueForKey(relationship.name) != nil {
                     setValue(nil, forKey: relationship.name)
                 }
             } else {

        guard let destinationEntityName = destinationEntity.name else { fatalError("entityName not found in entity: \(destinationEntity)") }
        guard let entity = NSEntityDescription.entityForName(destinationEntityName, inManagedObjectContext: managedObjectContext) else { return }
        if localPrimaryKey is NSNull {
            if let _ = valueForKey(relationship.name) {
                setValue(nil, forKey: relationship.name)
            }
        } else {

     */
    func sync_toManyRelationship(relationship: NSRelationshipDescription, dictionary: [String : AnyObject], parent: NSManagedObject?, parentRelationship: NSRelationshipDescription?, dataStack: DATAStack, operations: DATAFilter.Operation) {
        var children: [[String : AnyObject]]?
        let childrenIsNull = relationship.userInfo?[SYNCCustomRemoteKey] is NSNull || dictionary[relationship.name.hyp_remoteString()] is NSNull || dictionary[relationship.name] is NSNull
        if childrenIsNull {
            children = [[String : AnyObject]]()

            if valueForKey(relationship.name) != nil {
