diff --git a/Cargo.lock b/Cargo.lock
index 485aeab16b33d4baca2b56083e49c29b85abe69a..4f58ef369d50cd446b4f9f4af57ff4a5caeb0b6e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -944,7 +944,7 @@ dependencies = [
 [[package]]
 name = "heed"
 version = "0.10.6"
-source = "git+https://github.com/timokoesters/heed.git?rev=c6b149fd5621999b0d5ef0c28e199015cfc60fa1#c6b149fd5621999b0d5ef0c28e199015cfc60fa1"
+source = "git+https://github.com/timokoesters/heed.git?rev=f6f825da7fb2c758867e05ad973ef800a6fe1d5d#f6f825da7fb2c758867e05ad973ef800a6fe1d5d"
 dependencies = [
  "bytemuck",
  "byteorder",
@@ -962,12 +962,12 @@ dependencies = [
 [[package]]
 name = "heed-traits"
 version = "0.7.0"
-source = "git+https://github.com/timokoesters/heed.git?rev=c6b149fd5621999b0d5ef0c28e199015cfc60fa1#c6b149fd5621999b0d5ef0c28e199015cfc60fa1"
+source = "git+https://github.com/timokoesters/heed.git?rev=f6f825da7fb2c758867e05ad973ef800a6fe1d5d#f6f825da7fb2c758867e05ad973ef800a6fe1d5d"
 
 [[package]]
 name = "heed-types"
 version = "0.7.2"
-source = "git+https://github.com/timokoesters/heed.git?rev=c6b149fd5621999b0d5ef0c28e199015cfc60fa1#c6b149fd5621999b0d5ef0c28e199015cfc60fa1"
+source = "git+https://github.com/timokoesters/heed.git?rev=f6f825da7fb2c758867e05ad973ef800a6fe1d5d#f6f825da7fb2c758867e05ad973ef800a6fe1d5d"
 dependencies = [
  "bincode",
  "bytemuck",
diff --git a/src/database.rs b/src/database.rs
index db0eae81391955ff610d634805ef76b746de3fbc..5e9e025d8f2bc4c6f0d05ddf401804515c22e6e8 100644
--- a/src/database.rs
+++ b/src/database.rs
@@ -430,8 +430,8 @@ pub async fn load_or_create(config: &Config) -> Result<Arc<TokioRwLock<Self>>> {
                 // Upgrade user data store
                 for (roomuserdataid, _) in db.account_data.roomuserdataid_accountdata.iter() {
                     let mut parts = roomuserdataid.split(|&b| b == 0xff);
-                    let user_id = parts.next().unwrap();
                     let room_id = parts.next().unwrap();
+                    let user_id = parts.next().unwrap();
                     let event_type = roomuserdataid.rsplit(|&b| b == 0xff).next().unwrap();
 
                     let mut key = room_id.to_vec();
diff --git a/src/database/sending.rs b/src/database/sending.rs
index 506bc171d283ee5db8cebdd2188ddbee50cd2848..7d7a44aad6c7d8e5bb4ab8db189d7d5752e95fe5 100644
--- a/src/database/sending.rs
+++ b/src/database/sending.rs
@@ -599,29 +599,25 @@ async fn handle_events(
                     match event {
                         SendingEventType::Pdu(pdu_id) => {
                             // TODO: check room version and remove event_id if needed
-                            pdu_jsons.push(serde_json::from_str(
-                                PduEvent::convert_to_outgoing_federation_event(
-                                    db.rooms
-                                        .get_pdu_json_from_id(&pdu_id)
-                                        .map_err(|e| (OutgoingKind::Normal(server.clone()), e))?
-                                        .ok_or_else(|| {
-                                            (
-                                                OutgoingKind::Normal(server.clone()),
-                                                Error::bad_database(
-                                                    "[Normal] Event in servernamevent_datas not found in db.",
-                                                ),
-                                            )
-                                        })?,
-                                )
-                                .json()
-                                .get(),
-                            )
-                            .expect("Raw<..> is always valid"));
+                            let raw = PduEvent::convert_to_outgoing_federation_event(
+                                db.rooms
+                                    .get_pdu_json_from_id(&pdu_id)
+                                    .map_err(|e| (OutgoingKind::Normal(server.clone()), e))?
+                                    .ok_or_else(|| {
+                                        (
+                                            OutgoingKind::Normal(server.clone()),
+                                            Error::bad_database(
+                                                "[Normal] Event in servernamevent_datas not found in db.",
+                                            ),
+                                        )
+                                    })?,
+                            );
+                            pdu_jsons.push(raw);
                         }
                         SendingEventType::Edu(edu) => {
-                            edu_jsons.push(
-                                serde_json::from_slice(edu).expect("Raw<..> is always valid"),
-                            );
+                            if let Ok(raw) = serde_json::from_slice(edu) {
+                                edu_jsons.push(raw);
+                            }
                         }
                     }
                 }
@@ -689,7 +685,7 @@ fn parse_servercurrentevent(
                     Error::bad_database("Invalid server string in server_currenttransaction")
                 })?),
                 if event.starts_with(b"*") {
-                    SendingEventType::Edu(value.to_vec())
+                    SendingEventType::Edu(value)
                 } else {
                     SendingEventType::Pdu(event.to_vec())
                 },
@@ -707,7 +703,7 @@ fn parse_servercurrentevent(
             (
                 OutgoingKind::Push(user.to_vec(), pushkey.to_vec()),
                 if event.starts_with(b"*") {
-                    SendingEventType::Edu(event[1..].to_vec())
+                    SendingEventType::Edu(value)
                 } else {
                     SendingEventType::Pdu(event.to_vec())
                 },