             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:

}

// Implement it as a tail recursive function.
private func valueFor(keyPathComponents: [String], dictionary: [String: AnyObject]) -> AnyObject? {
    if keyPathComponents.isEmpty {
        return nil
    }


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