             { return }
         defunctObserverCheckCounter = 0
 
-        for i in observers.keys
-            { observers[i]?.cleanUp() }
+        for observer in observers.values
+            { observer.cleanUp() }
 
         let removed = observers.removeValues { $0.isDefunct }
 

        cleanDefunctObservers()

        let identity = observer.observerIdentity
        if observers.keys.contains(identity)
            {
            // have to use observers[i] instead of loop var to
            // make mutator actually change struct in place in array
            observers[identity]?.addOwner(owner)
            observersChanged()
            return self
            }

        var newEntry = ObserverEntry(observer: observer, resource: self)
        newEntry.addOwner(owner)
        observers[identity] = newEntry
        observer.resourceChanged(self, event: .observerAdded)

        guard let owner = owner else
            { return }

        for observer in observers.values
            { observer.removeOwner(owner) }

        cleanDefunctObservers()
        }
