diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index 2b8f57920b58250e09ee9148c54052e01d60555b..ae08b304627d65b5d6d5c453a6cf5eb664d11b50 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -676,7 +676,7 @@ void phy_config_dedicated_ue(u8 Mod_id,u8 CH_index,
 }
 
 void  phy_config_cba_rnti (u8 Mod_id,u8 eNB_flag, u8 index, u16 cba_rnti, u8 cba_group_id, u8 num_active_cba_groups){
-  u8 i;
+//   u8 i;
   
   if (eNB_flag == 0 ) {
     //LOG_D(PHY,"[UE %d] configure cba group %d with rnti %x, num active cba grp %d\n", index, index, cba_rnti, num_active_cba_groups);
@@ -1233,7 +1233,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
       ue_pdcch_vars[eNB_id]->llr16 = (unsigned short *)malloc16(2*4*frame_parms->N_RB_DL*12*sizeof(unsigned short));
       ue_pdcch_vars[eNB_id]->wbar = (unsigned short *)malloc16(4*frame_parms->N_RB_DL*12*sizeof(unsigned short));
       
-      ue_pdcch_vars[eNB_id]->e_rx = (char *)malloc16(4*2*frame_parms->N_RB_DL*12*sizeof(unsigned char));
+      ue_pdcch_vars[eNB_id]->e_rx = (s8 *)malloc16(4*2*frame_parms->N_RB_DL*12*sizeof(unsigned char));
       
       // PBCH
       ue_pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16(sizeof(LTE_UE_PBCH));
@@ -1249,7 +1249,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
 	  ue_pbch_vars[eNB_id]->rxdataF_comp[(j<<1)+i]        = (int *)malloc16(sizeof(int)*(6*12*4));
 	  ue_pbch_vars[eNB_id]->dl_ch_estimates_ext[(j<<1)+i] = (int *)malloc16(sizeof(int)*6*12*4);
 	}    
-      ue_pbch_vars[eNB_id]->llr = (char *)malloc16(1920*sizeof(char));
+      ue_pbch_vars[eNB_id]->llr = (s8 *)malloc16(1920*sizeof(char));
       
       //    ue_pbch_vars[eNB_id]->channel_output = (short *)malloc16(*sizeof(short));
       
@@ -1371,7 +1371,10 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
     phy_vars_ue->sinr_dB = (double*) malloc16(frame_parms->N_RB_DL*12*sizeof(double));
   }
 
-   phy_vars_ue->sinr_CQI_dB = (double*) malloc16(frame_parms->N_RB_DL*12*sizeof(double));
+  phy_vars_ue->sinr_CQI_dB = (double*) malloc16(frame_parms->N_RB_DL*12*sizeof(double));
+#if defined(OAI_EMU)
+  memset(phy_vars_ue->sinr_CQI_dB, 0, frame_parms->N_RB_DL*12*sizeof(double));
+#endif
   phy_vars_ue->init_averaging = 1;
 
   phy_vars_ue->pdsch_config_dedicated->p_a = PDSCH_ConfigDedicated__p_a_dB0; //defaul value until overwritten by RRCConnectionReconfiguration
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_est_freq_offset.c b/openair1/PHY/LTE_ESTIMATION/lte_est_freq_offset.c
index 0b87c42312eadcb44daab6dcd26d2234f493b4eb..0b3aead6b0da4a64c4f6d7776b9aaf6546455457 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_est_freq_offset.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_est_freq_offset.c
@@ -150,7 +150,7 @@ int lte_mbsfn_est_freq_offset(int **dl_ch_estimates,
   ch_offset = (l*(frame_parms->ofdm_symbol_size));
  
   if ((l!=2) && (l!=6) && (l!=10)) {
-    msg("lte_est_freq_offset: l (%d) must be 2 or 6 or 10");
+    msg("lte_est_freq_offset: l (%d) must be 2 or 6 or 10", l);
     return(-1);
   }
 
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
index e17b6b339a89c56391fbf206468bfdb5ab1ec0b1..0a44e30111ff44dd9d65034a5921fcb33a66f911 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
@@ -132,6 +132,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, u8 abs
     ulsch->Mdlharq = Mdlharq;
     for (i=0;i<Mdlharq;i++) {
       ulsch->harq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t));
+      memset(ulsch->harq_processes[i], 0, sizeof(LTE_UL_UE_HARQ_t));
       //      printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]);
       if (ulsch->harq_processes[i]) {
 	ulsch->harq_processes[i]->b          = (unsigned char*)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
diff --git a/openair1/PHY/TOOLS/file_output.c b/openair1/PHY/TOOLS/file_output.c
index 3b2069b01108acad244f531a8ac0b84a6b8eddb4..dc8aa8618fd578633860c3b96b1946571b369f3e 100755
--- a/openair1/PHY/TOOLS/file_output.c
+++ b/openair1/PHY/TOOLS/file_output.c
@@ -151,6 +151,7 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
 	fclose(fp);  
 	return(0);
   }
+  return 0;
 }
 
 #endif // USER_MODE
diff --git a/openair1/SIMULATION/TOOLS/abstraction.c b/openair1/SIMULATION/TOOLS/abstraction.c
index 03e95befe3fb7ddeec33a683b923958e9e4c86e1..3eb0affbd31d7a9b42f0c6cf48ab4dd2b5b959d5 100644
--- a/openair1/SIMULATION/TOOLS/abstraction.c
+++ b/openair1/SIMULATION/TOOLS/abstraction.c
@@ -187,7 +187,7 @@ double compute_sinr(channel_desc_t *desc,
   return(10*log10(avg_sinr/(nb_rb*2)));
 }
 
-u8 pbch_polynomial_degree;
+int pbch_polynomial_degree;
 double a[7];
 
 void load_pbch_desc(FILE *pbch_file_fd) {
diff --git a/openair2/RRC/NAS/rb_config.c b/openair2/RRC/NAS/rb_config.c
index b4333de10040391b55ee3987da725bf741043254..707da2da84ca8e917863113c7a5daabe73f39d39 100644
--- a/openair2/RRC/NAS/rb_config.c
+++ b/openair2/RRC/NAS/rb_config.c
@@ -8,8 +8,10 @@
 * \warning 
 * @ingroup driver
 
-*/ 
+*/
 
+#include <sys/ioctl.h>
+#include <arpa/inet.h>
 
 #include "nas_config.h"
 #include "UTIL/LOG/log.h"
@@ -57,8 +59,6 @@ void rb_ioctl_init(int inst) {
 
 int rb_validate_config_ipv4(int cx, int inst, int rb) {
 
-  struct sockaddr_in sa;
-
   if (inst == -1){
     LOG_E(OIP,"Specify an interface\n");
     return(1);
@@ -92,8 +92,6 @@ int rb_conf_ipv4(int action,int cx, int inst, int rb, int dscp, in_addr_t saddr_
 //int rb_conf(rb_config *rb_cfg) {
 
   int err;
-  unsigned int mpls_outlabel,mpls_inlabel;
-  char addr_str[46];
   
   struct nas_msg_rb_establishment_request *msgreq; 
   struct nas_msg_class_add_request *msgreq_class;  
@@ -242,10 +240,10 @@ int rb_stats_req(int inst) {
 
 in_addr_t ipv4_address (int thirdOctet, int fourthOctet){
 
-  in_addr_t saddr_ipv4;
+  struct in_addr saddr_ipv4;
   char ipAddress[20];
   sprintf(ipAddress, "10.0.%d.%d",thirdOctet,fourthOctet);
   inet_aton(ipAddress,&saddr_ipv4);
-  return saddr_ipv4;
+  return saddr_ipv4.s_addr;
 
 }
diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c
index cbea8a60df94f78d3e9d03fb16b703009f3221b7..f769c36cb047501c25df87854c45fc45a40e9b82 100644
--- a/targets/SIMU/USER/init_lte.c
+++ b/targets/SIMU/USER/init_lte.c
@@ -173,9 +173,11 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
 
   mac_xface = malloc(sizeof(MAC_xface));
 
+  memset(mac_xface, 0, sizeof(MAC_xface));
+
   LOG_I(PHY,"init lte parms: Nid_cell %d, Frame type %d, N_RB_DL %d\n",Nid_cell,frame_type,N_RB_DL);
 
-  *frame_parms = malloc(sizeof(LTE_DL_FRAME_PARMS));
+  *frame_parms = calloc(1, sizeof(LTE_DL_FRAME_PARMS));
   (*frame_parms)->frame_type         = frame_type;
   (*frame_parms)->tdd_config         = tdd_config;
   (*frame_parms)->tdd_config_S       = tdd_config_S;