diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index 95cff7cf58bf061dc9eb526e9bef9776dde6b4b7..a1e05d4dc301aac6f6b8f97547f470093a5747de 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -412,10 +412,8 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
   RU_t *ru;
   RU_proc_t *ru_proc;
 
-  int waitret,ret;
+  int waitret = 0,ret;
  
-
-
 // note this  should depend on the numerology used by the TX L1 thread, set here for 500us slot time
   AssertFatal((ret = pthread_mutex_lock(&proc->mutex_RUs_tx))==0,"mutex_lock returns %d\n",ret);
   while (proc->instance_cnt_RUs < 0) {
@@ -425,7 +423,6 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
   VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs);
   AssertFatal((ret = pthread_mutex_unlock(&proc->mutex_RUs_tx))==0,"mutex_unlock returns %d\n",ret);
 
-
   VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs);
 
   if (waitret == ETIMEDOUT) {
diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
index 56c7b4214b5646f6b6a4b4f6af80cfba507913a3..1bb544d204238a485f58423e208b329943d2b610 100644
--- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c
+++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
@@ -358,7 +358,7 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id,
 
 void nr_fill_crc_indication (PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t crc_flag){
   // pthread_mutex_lock(&gNB->UL_INFO_mutex);
-  nfapi_crc_indication_pdu_t *pdu = &gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
+  // nfapi_crc_indication_pdu_t *pdu = &gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
   // gNB->UL_INFO.crc_ind.sfn_sf                         = frame<<4 | subframe;
   // gNB->UL_INFO.crc_ind.header.message_id              = NFAPI_CRC_INDICATION;
   // gNB->UL_INFO.crc_ind.crc_indication_body.tl.tag     = NFAPI_CRC_INDICATION_BODY_TAG;
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
index 79851c7179c8ed839970a357afb3e650cf4b8b25..579f5c6928069da8b7b1758a83eefd71667a77ab 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
@@ -2067,8 +2067,8 @@ void nr_ue_send_sdu(module_id_t module_idP,
 
   if (opt_enabled) {
     trace_pdu(DIRECTION_DOWNLINK, pduP, pdu_len, module_idP, WS_C_RNTI,
-    UE_mac_inst[module_idP].cs_RNTI, frameP, ttiP, 0, 0); //subframeP
-    LOG_D(OPT, "[UE %d][DLSCH] Frame %d trace pdu for rnti %x  with size %d\n",
+    (int) UE_mac_inst[module_idP].cs_RNTI, frameP, ttiP, 0, 0); //subframeP
+    LOG_D(OPT, "[UE %d][DLSCH] Frame %d trace pdu for rnti %p  with size %d\n",
       module_idP, frameP, UE_mac_inst[module_idP].cs_RNTI, pdu_len);
     }
 
@@ -2115,7 +2115,7 @@ void nr_ue_process_mac_pdu(
     // This function is adapting code from the old
     // parse_header(...) and ue_send_sdu(...) functions of OAI LTE
 
-    uint8_t *pdu_ptr = pduP, rx_lcid, done = 0, i;
+    uint8_t *pdu_ptr = pduP, rx_lcid, done = 0;
     int pdu_len = mac_pdu_len;
     uint16_t mac_ce_len, mac_subheader_len, mac_sdu_len;
 
diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c
index 2512cf68204eea804fbc079c664087a6ea693619..11c6d27f5facd1d66f36b00d276d40f0ea9bdaeb 100644
--- a/openair2/RRC/LTE/rrc_eNB_S1AP.c
+++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c
@@ -1686,6 +1686,9 @@ int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *ms
   memcpy(&e_rab_release_params[0], &(S1AP_E_RAB_RELEASE_COMMAND (msg_p).e_rab_release_params[0]), sizeof(e_rab_release_t)*S1AP_MAX_E_RAB);
   eNB_ue_s1ap_id = S1AP_E_RAB_RELEASE_COMMAND (msg_p).eNB_ue_s1ap_id;
   nb_e_rabs_torelease = S1AP_E_RAB_RELEASE_COMMAND (msg_p).nb_e_rabs_torelease;
+  if (nb_e_rabs_torelease > S1AP_MAX_E_RAB) {
+    return -1;
+  }
   ue_context_p   = rrc_eNB_get_ue_context_from_s1ap_ids(instance, UE_INITIAL_ID_INVALID, eNB_ue_s1ap_id);
 
   if(ue_context_p != NULL) {