             let targetProxy = targetDependency.targetProxy,
             let remoteGlobalIDReference = targetProxy.remoteGlobalIDReference {
             var identifiers = identifiers
-            identifiers.append(String(describing: targetProxy))
             identifiers.append(remoteGlobalIDReference.value)
-            targetProxyReference.fix(generate(identifiers: identifiers))
+            targetProxy.fixReference(identifiers: identifiers)
         }
 
         // Target dependency

            guard let buildFile: PBXBuildFile = buildFileReference.object() else { return }

            var identifiers = identifiers
            identifiers.append(String(describing: buildFile))

            if let fileReference = buildFile.fileReference,
                let fileReferenceObject: PBXObject = fileReference.object() {
                identifiers.append(fileReferenceObject.reference.value)
            }

            buildFileReference.fix(generate(identifiers: identifiers))
        }
    }


    fileprivate func generateBuildPhaseReferences(_ buildPhase: PBXBuildPhase,
                                                  identifiers: [String]) throws {
        var identifiers = identifiers
        if let name = buildPhase.name() {
            identifiers.append(name)
        }

        // Build phase
        buildPhase.fixReference(identifiers: identifiers)

        // Build files
        buildPhase.fileReferences.forEach { buildFileReference in
