         let subStorage = storage[bounds.lowerBound ..< bounds.upperBound]
         var newStorage = WeakDictionary<WeakDictionaryKey<Key, Value>, Value>()
         
-        subStorage.filter({ key, value in return key.baseKey != nil && value.value != nil }).forEach({
+        subStorage.filter({ key, value in return key.key != nil && value.value != nil }).forEach({
             key, value in
             newStorage[key] = value.value
         })

}

public struct WeakDictionaryReference<Value : AnyObject> {
    fileprivate weak var value: Value?
}

private let nilKeyHash = UUID().hashValue

public struct WeakDictionaryKey<Key : AnyObject & Hashable, Value : AnyObject> : Hashable {
    
    fileprivate weak var baseKey: Key?
    private let hash: Int
    private var retainedValue: Value?
    

    public var hashValue: Int {
        return baseKey != nil ? hash : nilKeyHash
    }
    
    public var key: Key? {
        get {
            return baseKey
        }
    }
}
