diff --git a/dnn/dred_rdovae_dec.c b/dnn/dred_rdovae_dec.c
index b6abd767f7e054c100b037f5630f24e0925e3bc8..965629c1f33ccf9581d7b99b974bc5e88a4f37b9 100644
--- a/dnn/dred_rdovae_dec.c
+++ b/dnn/dred_rdovae_dec.c
@@ -29,7 +29,7 @@
 #include "config.h"
 #endif
 
-
+#include "common.h"
 #include "dred_rdovae_dec.h"
 #include "dred_rdovae_constants.h"
 
@@ -63,7 +63,7 @@ void dred_rdovae_decode_qframe(
     output_index += DEC_DENSE1_OUT_SIZE;
 
     compute_gruB(&dec_dense2, zero_vector, dec_state->dense2_state, &buffer[input_index]);
-    memcpy(&buffer[output_index], dec_state->dense2_state, DEC_DENSE2_OUT_SIZE * sizeof(float));
+    RNN_COPY(&buffer[output_index], dec_state->dense2_state, DEC_DENSE2_OUT_SIZE);
     input_index = output_index;
     output_index += DEC_DENSE2_OUT_SIZE;
 
@@ -72,7 +72,7 @@ void dred_rdovae_decode_qframe(
     output_index += DEC_DENSE3_OUT_SIZE;
 
     compute_gruB(&dec_dense4, zero_vector, dec_state->dense4_state, &buffer[input_index]);
-    memcpy(&buffer[output_index], dec_state->dense4_state, DEC_DENSE4_OUT_SIZE * sizeof(float));
+    RNN_COPY(&buffer[output_index], dec_state->dense4_state, DEC_DENSE4_OUT_SIZE);
     input_index = output_index;
     output_index += DEC_DENSE4_OUT_SIZE;
 
@@ -81,7 +81,7 @@ void dred_rdovae_decode_qframe(
     output_index += DEC_DENSE5_OUT_SIZE;
 
     compute_gruB(&dec_dense6, zero_vector, dec_state->dense6_state, &buffer[input_index]);
-    memcpy(&buffer[output_index], dec_state->dense6_state, DEC_DENSE6_OUT_SIZE * sizeof(float));
+    RNN_COPY(&buffer[output_index], dec_state->dense6_state, DEC_DENSE6_OUT_SIZE);
     input_index = output_index;
     output_index += DEC_DENSE6_OUT_SIZE;
 
@@ -93,4 +93,4 @@ void dred_rdovae_decode_qframe(
     output_index += DEC_DENSE8_OUT_SIZE;
 
     _lpcnet_compute_dense(&dec_final, qframe, buffer);
-}
\ No newline at end of file
+}
diff --git a/dnn/dred_rdovae_enc.c b/dnn/dred_rdovae_enc.c
index f38d7971ee9907f3f2962b377820134cc4f0a337..a8dad8540590608027370c9aaf66c53af8b74e02 100644
--- a/dnn/dred_rdovae_enc.c
+++ b/dnn/dred_rdovae_enc.c
@@ -33,7 +33,7 @@
 
 
 #include "dred_rdovae_enc.h"
-
+#include "common.h"
 
 void dred_rdovae_encode_dframe(
     RDOVAEEnc *enc_state,           /* io: encoder state */
@@ -53,7 +53,7 @@ void dred_rdovae_encode_dframe(
     output_index += ENC_DENSE1_OUT_SIZE;
 
     compute_gruB(&enc_dense2, zero_vector, enc_state->dense2_state, &buffer[input_index]);
-    memcpy(&buffer[output_index], enc_state->dense2_state, ENC_DENSE2_OUT_SIZE * sizeof(float));
+    RNN_COPY(&buffer[output_index], enc_state->dense2_state, ENC_DENSE2_OUT_SIZE);
     input_index = output_index;
     output_index += ENC_DENSE2_OUT_SIZE;
 
@@ -62,7 +62,7 @@ void dred_rdovae_encode_dframe(
     output_index += ENC_DENSE3_OUT_SIZE;
 
     compute_gruB(&enc_dense4, zero_vector, enc_state->dense4_state, &buffer[input_index]);
-    memcpy(&buffer[output_index], enc_state->dense4_state, ENC_DENSE4_OUT_SIZE * sizeof(float));
+    RNN_COPY(&buffer[output_index], enc_state->dense4_state, ENC_DENSE4_OUT_SIZE);
     input_index = output_index;
     output_index += ENC_DENSE4_OUT_SIZE;
 
@@ -71,7 +71,7 @@ void dred_rdovae_encode_dframe(
     output_index += ENC_DENSE5_OUT_SIZE;
 
     compute_gruB(&enc_dense6, zero_vector, enc_state->dense6_state, &buffer[input_index]);
-    memcpy(&buffer[output_index], enc_state->dense6_state, ENC_DENSE6_OUT_SIZE * sizeof(float));
+    RNN_COPY(&buffer[output_index], enc_state->dense6_state, ENC_DENSE6_OUT_SIZE);
     input_index = output_index;
     output_index += ENC_DENSE6_OUT_SIZE;
 
diff --git a/dnn/write_lpcnet_weights.c b/dnn/write_lpcnet_weights.c
index 6bcdb72edf052452ab65a5f8f587912059452e42..12328ab3c60f25c8a66662101a9a6d3d489e8abd 100644
--- a/dnn/write_lpcnet_weights.c
+++ b/dnn/write_lpcnet_weights.c
@@ -29,6 +29,7 @@
 #endif
 
 #include <stdio.h>
+#include <string.h>
 #include "nnet.h"
 
 /* This is a bit of a hack because we need to build nnet_data.c and plc_data.c without USE_WEIGHTS_FILE,
@@ -62,7 +63,7 @@ void write_weights(const WeightArray *list, FILE *fout)
   }
 }
 
-int main()
+int main(void)
 {
   FILE *fout = fopen("weights_blob.bin", "w");
   write_weights(lpcnet_arrays, fout);