         case .key(let key):
             self.model = try unboxer.unbox(key: key)
         case .keyPath(let keyPath):
-            self.model = try unboxer.unbox(key: keyPath, isKeyPath: true)
+            self.model = try unboxer.unbox(keyPath: keyPath)
         }
     }
 }

        return try UnboxValueResolver<Any>(self).resolveValue(forPath: .keyPath(keyPath), transform: transform)
    }
    
    /// Unbox a required nested Unboxable, by unboxing a Dictionary and then using a transform
    public func unbox<T: Unboxable>(key: String, isKeyPath: Bool = true, context: Any? = nil) throws -> T {
        return try UnboxValueResolver<UnboxableDictionary>(self).resolveRequiredValueForKey(key: key, isKeyPath: isKeyPath, transform: {
            return try? Unbox(dictionary: $0)
        })
    }
    
    /// Unbox an optional nested Unboxable, by unboxing a Dictionary and then using a transform
    public func unbox<T: Unboxable>(key: String, isKeyPath: Bool = true, context: Any? = nil) -> T? {
        return UnboxValueResolver<UnboxableDictionary>(self).resolveOptionalValueForKey(key: key, isKeyPath: isKeyPath, transform: {
            return try? Unbox(dictionary: $0)
        })
    }
    
    /// Unbox a required nested UnboxableWithContext type

    static func makeTransform(allowInvalidElements: Bool) -> (Any) throws -> Self? {
        return {
            try self.unbox(value: $0, allowInvalidCollectionElements: allowInvalidElements)
        }
    }
}

private extension Unboxable {
    static func makeTransform() -> (Any) throws -> Self? {
        return {
            guard let dictionary = $0 as? UnboxableDictionary else {
                return nil
            }
            
            let unboxed: Self = try Unbox(dictionary: dictionary)
            return unboxed
        }
    }
}
