diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 4f9b1547007d48e3e1224712689cea26f45a520f..07278d82b143a7d4ce640c92a447085510f33574 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -33,6 +33,13 @@ ORIGIN_PATH=$PWD
 THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
 source $THIS_SCRIPT_PATH/tools/build_helper
 
+# set environment variables (OPENAIR_HOME, ...)
+set_openair_env
+
+#variables for UE data generation
+gen_nvram_path=$OPENAIR_DIR/targets/bin
+conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
+
 MSC_GEN="False"
 XFORMS="True"
 FLEXRAN_AGENT_SB_IF="True"
@@ -59,9 +66,6 @@ BUILD_ECLIPSE=0
 CMAKE_CMD='cmake'
 trap handle_ctrl_c INT
 
-gen_nvram_path=$OPENAIR_DIR/targets/bin
-conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
-
 function print_help() {
   echo_info "
 This program installs OpenAirInterface Software
@@ -404,7 +408,6 @@ function main() {
 
   echo_info "2. Setting the OAI PATHS ..."
 
-  set_openair_env
   cecho "OPENAIR_DIR    = $OPENAIR_DIR" $green
 
   # for conf files copy in this bash script
@@ -774,9 +777,9 @@ function main() {
   
   # build RF device and transport protocol libraries
   #####################################
-  if [ "$eNB" = "1" -o  "$RRH" = "1" ] ; then
+  if [ "$eNB" = "1" -o "$UE" = "1" -o  "$RRH" = "1" ] ; then
 
-      if [ "$eNB" = "1" ] ; then
+      if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
 	  build_dir=$lte_build_dir	  
       else
 	  build_dir=$rrh_build_dir	 
diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c
index dd057f997513a2cc6a4bc45fe4545689dc5068a6..cea702ef7804d69da774a5eca5e9027df3a05b8f 100644
--- a/openair1/PHY/TOOLS/lte_phy_scope.c
+++ b/openair1/PHY/TOOLS/lte_phy_scope.c
@@ -493,7 +493,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
   int16_t **chest_f;
   int16_t *pdsch_llr;
   int16_t *pdsch_comp;
-  int8_t *pdcch_llr;
+  int16_t *pdsch_mag;
+  int8_t  *pdcch_llr;
   int16_t *pdcch_comp;
   int8_t *pbch_llr;
   int16_t *pbch_comp;
@@ -571,6 +572,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
   pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0
   //    pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
   pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0];
+  pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0];
 
   // Received signal in time domain of receive antenna 0
   if (rxsig_t != NULL) {
@@ -752,8 +754,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
 
     for (k=0; k<frame_parms->symbols_per_tti; k++) {
       for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
-        I[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i];
-        Q[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i+1];
+    	int j = (2*frame_parms->N_RB_DL*12*k)+4*i;
+        I[ind] = (pdsch_mag[j  ]!=0? 1.0/pdsch_mag[j  ]: 0.0) * pdsch_comp[j  ]*1.0;
+        Q[ind] = (pdsch_mag[j+1]!=0? 1.0/pdsch_mag[j+1]: 0.0) * pdsch_comp[j+1]*1.0;
         ind++;
       }
     }
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index a9142a9918928efd65955715fc8c8abceb5a84c4..2f2be51aaa45bc3f3650833f285e5b7288c15fca 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -190,7 +190,7 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
     eNB = PHY_vars_eNB_g[Mod_idP][CC_id];
     for (i=0; i<NUMBER_OF_UE_MAX; i++) {
       if ((eNB->dlsch[i]==NULL) || (eNB->ulsch[i]==NULL)) {
-	MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti);
+	MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rntiP);
 	LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
 	return(-1);
       } else {
diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c
index 4c50aaa5d540ca3c18a7718ff6f904db7844c26d..2b13449c6172498a3ee2c07fd49ec41e2fb9b7e5 100644
--- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c
+++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c
@@ -653,6 +653,7 @@ int main(int argc, char **argv)
       printf("-h This message\n");
       printf("-a Use AWGN channel and not multipath\n");
       printf("-c TDD config\n");
+      printf("-S Subframe number (0..9)\n");
       printf("-R N_RB_DL\n");
       printf("-F use FDD frame\n");
       printf("-p Use extended prefix mode\n");
diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c
index c27c0d524eaf8a7b2e036cfe46103630d4f6e114..6bf552ab18190eb51dd4e0045121b16f9366dfb1 100644
--- a/openair2/LAYER2/MAC/ue_procedures.c
+++ b/openair2/LAYER2/MAC/ue_procedures.c
@@ -353,7 +353,7 @@ ue_send_sdu(
 
   if (opt_enabled) {
     trace_pdu(1, sdu, sdu_len, module_idP, 3, UE_mac_inst[module_idP].crnti,
-        UE_mac_inst[module_idP].rxFrame, UE_mac_inst[module_idP].rxSubframe, 0, 0);
+        frameP, subframeP, 0, 0);
     LOG_D(OPT,"[UE %d][DLSCH] Frame %d trace pdu for rnti %x  with size %d\n",
           module_idP, frameP, UE_mac_inst[module_idP].crnti, sdu_len);
   }
@@ -1923,7 +1923,7 @@ if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY)
   if (opt_enabled) {
     trace_pdu(0, ulsch_buffer, buflen, module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].txFrame, UE_mac_inst[module_idP].txSubframe, 0, 0);
     LOG_D(OPT,"[UE %d][ULSCH] Frame %d subframe %d trace pdu for rnti %x  with size %d\n",
-          module_idP, UE_mac_inst[module_idP].txFrame, UE_mac_inst[module_idP].txSubframe, UE_mac_inst[module_idP].crnti, buflen);
+          module_idP, frameP, subframe, UE_mac_inst[module_idP].crnti, buflen);
   }
 }
 
@@ -2104,7 +2104,7 @@ ue_scheduler(
       /*
       if (lcid == DCCH) {    
         LOG_D(MAC,"[UE %d][SR] Frame %d subframe %d Pending data for SRB1=%d for LCGID %d \n",                  
-        module_idP, frameP,subframeP,UE_mac_inst[module_idP].scheduling_info.BSR[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]],                  
+        module_idP, txFrameP,txSubframeP,UE_mac_inst[module_idP].scheduling_info.BSR[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]],                  
 //         UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]);
       }
       */
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
index 873e51fbfe395c0e6aa48909a11c46830d682a59..3a9172a1c42cb843b49fd34f3b11bbacb36025d3 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
@@ -91,7 +91,7 @@ rlc_am_send_sdu (
   const protocol_ctxt_t* const ctxt_pP,
   rlc_am_entity_t * const      rlc_pP)
 {
-#   if TRACE_RLC_UM_PDU
+#   if TRACE_RLC_AM_PDU
   char                 message_string[7000];
   size_t               message_string_size = 0;
 #if ENABLE_ITTI
diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c
index 9a2d6a96ef1735d18a8c4e6825ce5cf75f82fef4..26f3f852c101f5cd617858b99b42ef7ada840ab1 100644
--- a/openair2/UTIL/LOG/log.c
+++ b/openair2/UTIL/LOG/log.c
@@ -1032,6 +1032,19 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
       if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
     }
 
+    if ( (g_log->flag & FLAG_THREAD) || (c->flag & FLAG_THREAD) ) {
+      #define THREAD_NAME_LEN 16
+      static char threadname[THREAD_NAME_LEN];
+      if (pthread_getname_np(pthread_self(), threadname, THREAD_NAME_LEN) != 0)
+      {
+        perror("pthread_getname_np : ");
+      } else {
+        len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", threadname);
+        if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+      }
+      #undef THREAD_NAME_LEN
+    }
+
     if ( (g_log->flag & FLAG_FUNCT) || (c->flag & FLAG_FUNCT) ) {
       len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s] ",
                       func);
@@ -1287,11 +1300,15 @@ int set_comp_log(int component, int level, int verbosity, int interval)
            LOG_EMERG);
   DevCheck((interval > 0) && (interval <= 0xFF), interval, 0, 0xFF);
 
+#if 0
   if ((verbosity == LOG_NONE) || (verbosity == LOG_LOW) ||
       (verbosity == LOG_MED) || (verbosity == LOG_FULL) ||
       (verbosity == LOG_HIGH)) {
     g_log->log_component[component].flag = verbosity;
   }
+#else
+  g_log->log_component[component].flag = verbosity;
+#endif
 
   g_log->log_component[component].level = level;
   g_log->log_component[component].interval = interval;
diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c
index 2ad68765e30cc0001c88e65684def3d9d8ca91e6..848b7011337d2e82e637426ebf91d2184e6a0078 100644
--- a/targets/RT/USER/lte-softmodem.c
+++ b/targets/RT/USER/lte-softmodem.c
@@ -329,6 +329,7 @@ void help (void) {
   printf("  --external-clock tells hardware to use an external clock reference\n");
   printf("  --usim-test use XOR autentication algo in case of test usim mode\n"); 
   printf("  --single-thread-disable. Disables single-thread mode in lte-softmodem\n"); 
+  printf("  -A Set timing_advance\n");
   printf("  -C Set the downlink frequency for all component carriers\n");
   printf("  -d Enable soft scope and L1 and L2 stats (Xforms)\n");
   printf("  -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n");
@@ -1417,7 +1418,7 @@ int main( int argc, char **argv ) {
         set_comp_log(HW,      LOG_DEBUG,  LOG_HIGH, 1);
         set_comp_log(PHY,     LOG_DEBUG,   LOG_HIGH, 1);
         set_comp_log(MAC,     LOG_INFO,   LOG_HIGH, 1);
-        set_comp_log(RLC,     LOG_INFO,   LOG_HIGH, 1);
+        set_comp_log(RLC,     LOG_INFO,   LOG_HIGH | FLAG_THREAD, 1);
         set_comp_log(PDCP,    LOG_INFO,   LOG_HIGH, 1);
         set_comp_log(OTG,     LOG_INFO,   LOG_HIGH, 1);
         set_comp_log(RRC,     LOG_INFO,   LOG_HIGH, 1);
diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c
index c783ebe0755aac4fecb45565d2e612c90215d8c8..b60e73e37c968151bb2db92e79a5405c94b691eb 100644
--- a/targets/SIMU/USER/oaisim.c
+++ b/targets/SIMU/USER/oaisim.c
@@ -243,7 +243,7 @@ help (void)
   printf ("-L [0-1] 0 to disable new link adaptation, 1 to enable new link adapatation\n");
   printf ("-m Gives a fixed DL mcs for eNB scheduler\n");
   printf ("-M Set the machine ID for Ethernet-based emulation\n");
-  printf ("-n Set the number of frames for the simulation\n");
+  printf ("-n Set the number of frames for the simulation. 0 for no limit\n");
   printf ("-O [enb_conf_file] eNB configuration file name\n");
   printf ("-p Set the total number of machine in emulation - valid if M is set\n");
   printf ("-P [trace type] Enable protocol analyzer. Possible values for OPT:\n");