                 return try transform(element)
             }
             
-            if let elementType = Element.self as? UnboxCompatibleType.Type {
+            if let elementType = Element.self as? UnboxCompatible.Type {
                 guard let value = try elementType.unbox(value: element, allowInvalidCollectionElements: allowInvalidElements) else {
                     return nil
                 }

    // MARK: - Unboxing optional values (by key)
    
    /// Unbox an optional value by key
    public func unbox<T: UnboxCompatibleType>(key: String) -> T? {
        return try? self.unbox(key: key)
    }
    

}

/// Protocol used to enable collections to be unboxed. Default implementations exist for Array & Dictionary
public protocol UnboxableCollection: Collection, UnboxCompatible {
    /// The raw collection type that this type can be unboxed from
    associatedtype UnboxRawCollection: Collection
    /// The value type that this collection contains
