      - Parameter identifiers: Identifiers of wanted services
      - Returns: Array of discovered services
      */
-    public func discoverServices(identifiers: [CBUUID]) -> Observable<[Service]> {
+    public func discoverServices(identifiers: [CBUUID]?) -> Observable<[Service]> {
         let observable = peripheral.rx_didDiscoverServices
         .flatMap({
             (services, error) -> Observable<[Service]> in
             if let discoveredServices = services {
                 let mapped = discoveredServices
-                .filter { identifiers.isEmpty || identifiers.contains($0.uuid) }
+                .filter { self.shouldBeIdentifierIncluded($0.uuid, forIdentifiers: identifiers) }
                 .map { Service(peripheral: self, service: $0) as Service }
                 return Observable.just(mapped)
             }
             return Observable.error(BluetoothError.ServicesDiscoveryFailed(self, error))
         })
         return Observable.deferred {
-            self.peripheral.discoverServices(identifiers.isEmpty ? nil : identifiers)
+            self.peripheral.discoverServices(identifiers)
             return self.ensureValidPeripheralState(observable)
         }
     }
+
+
 
     /**
      Triggers included services discovery.

    - Parameter identifiers: Identifiers of wanted characteristics
    - Returns: Stream of characteristics
    */
    public func discoverCharacteristics(identifiers: [CBUUID], service: Service) -> Observable<[Characteristic]> {
        let observable = peripheral.rx_didDiscoverCharacteristicsForService
        .flatMap { (cbService, error) -> Observable<[Characteristic]> in
            if let characteristics = cbService.characteristics where error == nil {
                let filtered = characteristics
                .filter { identifiers.isEmpty || identifiers.contains($0.uuid) }
                .map { Characteristic(characteristic: $0, service: service) }
                return Observable.just(filtered)
            }
            return Observable.error(BluetoothError.CharacteristicsDiscoveryFailed(service, error))
        }
        return Observable.deferred {
            self.peripheral.discoverCharacteristics(identifiers.isEmpty ? nil : identifiers, forService: service.service)
            return self.ensureValidPeripheralState(observable)
        }
    }

        .map { (self, $0) }
        return ensureValidPeripheralState(observable)
    }

    private func shouldBeIdentifierIncluded(identifier: CBUUID, forIdentifiers identifiers: [CBUUID]?) -> Bool {
        if let identifiers = identifiers {
            return identifiers.contains(identifier)
        }
        return true
    }
}

extension Peripheral: Equatable {
