     
     /// Add `newElements` to the Set.
     mutating func insert(_ elements: Element...) {
-        elements.forEach { contents[$0.id] = $0 }
+        elements.forEach {
+            if let id = $0.id {
+                contents[id] = $0
+            }
+        }
     }
     
     /// Overloaded version that accepts an array instead of varadic parameters
     mutating func insert(_ elements: [Element]) {
-        elements.forEach { contents[$0.id] = $0 }
+        elements.forEach {
+            if let id = $0.id {
+                contents[id] = $0
+            }
+        }
     }
     
     /// Remove `element` from the Set.
     @discardableResult mutating func remove(_ element: Element) -> Element? {
-        return contents.removeValue(forKey: element.id)
+        guard let id = element.id else { return nil }
+        return contents.removeValue(forKey: id)
     }
 }
 

// MARK: RecordSet Easier initialization
extension RecordSet {
    init<S: Sequence>(_ sequence: S) where S.Iterator.Element == Element {
        sequence.forEach { contents[$0.id] = $0 }
    }
}


    public init(arrayLiteral elements: Element...) {
        self.init(elements)
    }
}

extension RecordSet {
