         buffer.append(value.typeIdentifier)
         
         // Then, the key name
-        buffer += key.utf8
+        buffer += key.utf8 + [0x00]
         
         // Lastly, the data
         buffer += value.bytes
         
         // Then, insert it into ourselves, before the ending 0-byte.
-        storage.insert(contentsOf: buffer, at: storage.endIndex-2)
+        storage.insert(contentsOf: buffer, at: storage.endIndex-1)
+        
+        // Increase the bytecount
+        updateDocumentHeader()
+    }
+    
+    private func updateDocumentHeader() {
+        // TODO: Update the count
     }
     
     public subscript(key: String) -> Value {

        // start at the begin of the element list, the fifth byte
        var position = 4
        
        while storage.count > position {
            /**** ELEMENT TYPE ****/
            if storage[position] == 0 {

    
    // MARK: - Other metadata
    public var count: Int {
        // TODO: Cache and calculate on first `count` request
        var position = 4
        var currentCount = 0
        
        // TODO: Check performance v.s. storing `storage.count` in a variable
        while storage.count > position {
            guard let elementType = ElementType(rawValue: storage[position]) else {
                return currentCount
            }
            
            position += 1
            
            skipKey: while storage.count > position {
                defer {
                    position += 1
                }
                
                if storage[position] == 0 {
                    break skipKey
                }
            }
            
            position += getLengthOfElement(withDataPosition: position, type: elementType)
            
            guard storage.count > position else {
                return currentCount
            }
            
            currentCount += 1
        }
        
        return currentCount
    }

    public var byteCount: Int {
