             
             storage.removeSubrange(position..<position+length)
             storage.insert(contentsOf: newValue.value.bytes, at: position)
+            
+            updateDocumentHeader()
         }
     }
     

        return keys
    }
    
    public func validatesAsArray() -> Bool {
        for key in makeKeyIterator() {
            for keyByte in key.keyData where keyByte < 30 || keyByte >= 40 {

    
    public init() {
        // the empty document is 5 bytes long.
        storage = [5,0,0,0,0]
    }
    
    // MARK: - Initialization from Swift Types & Literals
