             return nil
 
         case let dict as [String: AnyObject] where keyPathComponents.count > 1:
-            let tail = Array(keyPathComponents[1..<keyPathComponents.count])
+            let tail = dropFirst(keyPathComponents)
             return valueFor(tail, dict)
             
         default:


    private func rawValue(key: String) -> AnyObject? {
        if let dictionary = rawValue as? [String: AnyObject] {
            return valueFor(key.componentsSeparatedByString("."), dictionary)
        } else {
            return nil
        }

}

// Implement it as a tail recursive function.
//
// `ArraySlice` is used for performance optimization.
// See https://gist.github.com/norio-nomura/d9ec7212f2cfde3fb662.
private func valueFor(keyPathComponents: ArraySlice<String>, dictionary: [String: AnyObject]) -> AnyObject? {
    if keyPathComponents.isEmpty {
        return nil
    }
