             for (identifier, var subscribed) in self.subscribed {
                 let weakBox = WeakBox(subscriber as AnyObject)
                 let _ = subscribed.remove(weakBox)
-                self.subscribed[identifier] = Set(subscribed.filter { $0.inner is T })
+                self.subscribed[identifier] = subscribed
             }
         }
     }

            #if DEBUG
                fatalError(message)
            #else
                print("Warning:", message)
            #endif
        }
    }

    fileprivate func validateEventType<T>(type eventType: T.Type) {
        let identifier = ObjectIdentifier(eventType)
        guard let registered = self.registered else {
            return
        }
        if registered[identifier] == nil {
            let names = Array(registered.values).joined(separator: ", ")
            let message = "Expected registered event type (e.g. \(names)), found: \(eventType)"
            #if DEBUG
                fatalError(message)
            #else
                print("Warning:", message)
            #endif
        }
    }
}

extension EventBus: EventRegistrable {
    public func register<T>(forEvent eventType: T.Type) {
        let identifier = ObjectIdentifier(eventType)
        if self.registered == nil {
            self.registered = [:]
        }
        self.registered![identifier] = String(describing: eventType)
    }
}

extension EventBus: EventSubscribable {
    public func add<T>(subscriber: T, for eventType: T.Type) {
        self.validateSubscriber(subscriber: subscriber)
        self.validateEventType(type: eventType)
        self.serialQueue.sync {
            let identifier = ObjectIdentifier(eventType)
            var subscribed = self.subscribed[identifier] ?? []
            let weakBox = WeakBox(subscriber as AnyObject)
            subscribed.insert(weakBox)
            self.subscribed[identifier] = Set(subscribed.filter { $0.inner is T })
        }
    }

    public func remove<T>(subscriber: T, for eventType: T.Type) {
        self.validateSubscriber(subscriber: subscriber)
        self.validateEventType(type: eventType)
        self.serialQueue.sync {
            let identifier = ObjectIdentifier(eventType)
            var subscribed = self.subscribed[identifier] ?? []
            let weakBox = WeakBox(subscriber as AnyObject)
            let _ = subscribed.remove(weakBox)
            self.subscribed[identifier] = Set(subscribed.filter { $0.inner is T })
        }
    }


    func notify<T>(_ eventType: T.Type, closure: @escaping (T) -> ())
}

public struct Options: OptionSet {

    public let rawValue: Int

    public init(rawValue: Int) {
        self.rawValue = rawValue
    }

    public static let warnUnknown = Options(rawValue: 1 << 0)

    public static let warnDropped = Options(rawValue: 1 << 1)

    public static let logEvents = Options(rawValue: 1 << 2)
}

public class EventBus {

    internal struct WeakBox: Hashable {
        internal weak var inner: AnyObject?

        internal init(_ inner: AnyObject) {
            self.inner = inner
        }

        internal static func == (lhs: WeakBox, rhs: WeakBox) -> Bool {
            return lhs.inner === rhs.inner
        }

        internal var hashValue: Int {
            guard let inner = self.inner else {
                return 0
            }
