     return _optionalRange(
       _ns.rangeOfCharacterFromSet(
         aSet, options: mask,
-        range: _toNSRange(aRange ? aRange! : indices(self))))
+        range: _toNSRange(aRange != nil ? aRange! : indices(self))))
   }
 
   // - (NSRange)rangeOfComposedCharacterSequenceAtIndex:(NSUInteger)anIndex

    locale: NSLocale? = nil
  ) -> Range<Index>? {
    return _optionalRange(
      locale ? _ns.rangeOfString(
        aString, options: mask,
        range: _toNSRange(searchRange ? searchRange! : indices(self)),
        locale: locale
      )
      : searchRange ? _ns.rangeOfString(
        aString, options: mask, range: _toNSRange(searchRange!)
      )
      : mask ? _ns.rangeOfString(aString, options: mask)

    // According to Ali Ozer, there may be some real advantage to
    // dispatching to the minimal selector for the supplied options.
    // So let's do that; the switch should compile away anyhow.
    return locale != nil ? _ns.compare(
      aString, options: mask,
      range: _toNSRange(range != nil ? range! : indices(self)), locale: locale)
    
    : range != nil ? _ns.compare(
      aString, options: mask, range: _toNSRange(range != nil ? range! : indices(self)))
      
    : mask ? _ns.compare(aString, options: mask)
      
