diff --git a/src/algorithms/generate.rs b/src/algorithms/generate.rs
index ad89bcaf..034cc985 100644
--- a/src/algorithms/generate.rs
+++ b/src/algorithms/generate.rs
@@ -77,7 +77,8 @@ pub(crate) fn generate_multi_prime_key_with_exp<R: CryptoRngCore>(
 
         for (i, prime) in primes.iter_mut().enumerate() {
             let bits = (todo / (nprimes - i)) as u32;
-            *prime = generate_prime_with_rng(rng, bits, bits);
+            let bits_precision = BoxedUint::zero_with_precision(bits).bits_precision();
+            *prime = generate_prime_with_rng(rng, bits, bits_precision);
             todo -= prime.bits() as usize;
         }
 
diff --git a/src/key.rs b/src/key.rs
index 28aac6f4..5ea588b0 100644
--- a/src/key.rs
+++ b/src/key.rs
@@ -34,7 +34,6 @@ pub struct RsaPublicKey {
     /// Typically 0x10001 (65537)
     e: u64,
 
-    #[cfg_attr(feature = "serde", serde(skip))]
     n_params: BoxedMontyParams,
 }
 
diff --git a/src/pkcs1v15/signature.rs b/src/pkcs1v15/signature.rs
index 3209ba30..27bb35f1 100644
--- a/src/pkcs1v15/signature.rs
+++ b/src/pkcs1v15/signature.rs
@@ -116,7 +116,7 @@ mod tests {
         use super::*;
         use serde_test::{assert_tokens, Configure, Token};
         let signature = Signature {
-            inner: BigUint::new(Vec::from([42])),
+            inner: BoxedUint::from(42u32),
             len: 1,
         };
 
diff --git a/src/pss/signature.rs b/src/pss/signature.rs
index e7aee64f..f936b1aa 100644
--- a/src/pss/signature.rs
+++ b/src/pss/signature.rs
@@ -110,7 +110,7 @@ mod tests {
         use super::*;
         use serde_test::{assert_tokens, Configure, Token};
         let signature = Signature {
-            inner: BigUint::new(Vec::from([42])),
+            inner: BoxedUint::from(42u32),
             len: 1,
         };