diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index c2ac403f32c4ca6d5fa6d5e9df9e7e2797603990..fcaaa9dacb6fd189588698a0d6d6c2bd4ecac8c7 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -250,7 +250,7 @@ add_boolean_option(UE_DEBUG_TRACE      False "Activate UE debug trace")
 add_boolean_option(UE_TIMING_TRACE     False "Activate UE timing trace")
 add_boolean_option(DISABLE_LOG_X       False "Deactivate all LOG_* macros")
 add_boolean_option(USRP_REC_PLAY       False "Enable USRP record playback mode")
-add_boolean_option(UE_NAS_USE_TUN      False "Enable UE NAS TUN device instead of ue_ip.ko")
+#add_boolean_option(UE_NAS_USE_TUN      False "Enable UE NAS TUN device instead of ue_ip.ko")
 add_boolean_option(BASIC_SIMULATOR     False "Has to be True when building the basic simulator, False otherwise")
 
 add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 5f2c7e9cc416ba0a18d2ce0b3e262e1e557d6f66..d14bd3ec6edd36fa031d252cf2a4aea6d845a6e1 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -936,7 +936,7 @@ fi
     echo "set (LINUX True )"                          >>  $cmake_file
     echo "set (PDCP_USE_NETLINK True )"               >>  $cmake_file
     echo "set (BASIC_SIMULATOR \"True\" )"            >>  $cmake_file
-    echo "set (UE_NAS_USE_TUN \"True\" )"             >>  $cmake_file
+#    echo "set (UE_NAS_USE_TUN \"True\" )"             >>  $cmake_file
     echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file
 
     echo_info "Build UE"
diff --git a/openair3/NAS/COMMON/EMM/MSG/emm_msg.c b/openair3/NAS/COMMON/EMM/MSG/emm_msg.c
index b9c9b93a9caf3625076d3351b7d0e35ba2261980..e4b5e31800c2ec39c6a02e7b993b0fb43854029c 100644
--- a/openair3/NAS/COMMON/EMM/MSG/emm_msg.c
+++ b/openair3/NAS/COMMON/EMM/MSG/emm_msg.c
@@ -44,9 +44,8 @@ Description Defines EPS Mobility Management messages
 #include "TLVDecoder.h"
 #include "TLVEncoder.h"
 
-#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
-# include "nas_itti_messaging.h"
-#endif
+
+#include "nas_itti_messaging.h"
 
 /****************************************************************************/
 /****************  E X T E R N A L    D E F I N I T I O N S  ****************/
@@ -89,8 +88,6 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
 
   int header_result;
   int decode_result;
-
-#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
   uint8_t *buffer_log = buffer;
   uint32_t len_log = len;
   int down_link;
@@ -100,7 +97,7 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
 # else
   down_link = 1;
 # endif
-#endif
+
 
   /* First decode the EMM message header */
   header_result = _emm_msg_decode_header(&msg->header, buffer, len);
@@ -291,7 +288,7 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
   int header_result;
   int encode_result;
 
-#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
+
   uint8_t *buffer_log = buffer;
   int down_link;
 
@@ -300,7 +297,7 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
 # else
   down_link = 0;
 # endif
-#endif
+
 
   /* First encode the EMM message header */
   header_result = _emm_msg_encode_header(&msg->header, buffer, len);
diff --git a/openair3/NAS/UE/ESM/esm_ebr_context.c b/openair3/NAS/UE/ESM/esm_ebr_context.c
index 7404cd8b8a83a751e21fad46eca07033e41afcac..c0827ed9db0852fa7127f6633a9a257ee1e79c73 100644
--- a/openair3/NAS/UE/ESM/esm_ebr_context.c
+++ b/openair3/NAS/UE/ESM/esm_ebr_context.c
@@ -48,21 +48,17 @@ Description Defines functions used to handle EPS bearer contexts.
 
 #include "emm_sap.h"
 #include "system.h"
-
-#if defined(ENABLE_ITTI)
-# include "assertions.h"
-#endif
+#include "assertions.h"
+#include "pdcp.h"
 
 
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#ifdef PDCP_USE_NETLINK
 #ifdef UESIM_EXPANSION
   #include "openairinterface5g_limits.h"
   extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
 #endif
-#endif
 extern uint8_t  nfapi_mode;
 
 /****************************************************************************/
@@ -282,10 +278,10 @@ int esm_ebr_context_create(
                 // this is for L2 FAPI simulator.
                 // change for multiple UE's like 256UEs.
                 // if it's made too many tables , OS may crush so we use one table.
-#ifdef PDCP_USE_NETLINK
+                if(PDCP_USE_NETLINK) {
 #ifdef UESIM_EXPANSION
-                uint16_t inst_nic = (pdn->ip_addr[3] & 0x000000FF) - 2;
-                res = sprintf(command_line,
+                  uint16_t inst_nic = (pdn->ip_addr[3] & 0x000000FF) - 2;
+                  res = sprintf(command_line,
                            "ifconfig oip%d %s netmask %s broadcast %s up && "
                            "ip rule add from %s/24 table %d && "
                            "ip rule add to %s/24 table %d && "
@@ -295,9 +291,9 @@ int esm_ebr_context_create(
                            ipv4_addr, 201,
                            inst_nic + 1, 201);
 
-               inst_pdcp_list[inst_nic] = ueid;
+                 inst_pdcp_list[inst_nic] = ueid;
 #else
-               res = sprintf(command_line,
+                 res = sprintf(command_line,
                           "ifconfig oip%d %s netmask %s broadcast %s up && "
                           "ip rule add from %s/32 table %d && "
                           "ip rule add to %s/32 table %d && "
@@ -307,7 +303,7 @@ int esm_ebr_context_create(
                           ipv4_addr, ueid + 201,
                           ueid + 1, ueid + 201);
 #endif
-#endif
+               } // PDCP_USE_NETLINK
              } else {
                res = sprintf(command_line,
                            "ifconfig oip%d %s netmask %s broadcast %s up && "
diff --git a/openair3/NAS/UE/nas_itti_messaging.c b/openair3/NAS/UE/nas_itti_messaging.c
index 0c5a2fec1fa67f828a1b13292d0d1473f1352e33..55566700d7bb513eca99e64c295caa6c46d40672 100644
--- a/openair3/NAS/UE/nas_itti_messaging.c
+++ b/openair3/NAS/UE/nas_itti_messaging.c
@@ -27,8 +27,9 @@
 
 #   define TASK_ORIGIN  TASK_NAS_UE
 
+
 #if (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) )
-static const uint8_t emm_message_ids[] = {
+__attribute__ ((unused)) static const uint8_t emm_message_ids[] = {
   ATTACH_REQUEST,
   ATTACH_ACCEPT,
   ATTACH_COMPLETE,
@@ -60,7 +61,7 @@ static const uint8_t emm_message_ids[] = {
   CS_SERVICE_NOTIFICATION,
 };
 
-static const uint8_t esm_message_ids[] = {
+__attribute__ ((unused)) static const uint8_t esm_message_ids[] = {
   ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST,
   ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT,
   ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT,
diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c
index cf46098b575cd3ce69ba51980760342978d42669..40cbcf917dae09f5c70cdbe362451643a92fac56 100644
--- a/targets/RT/USER/lte-uesoftmodem.c
+++ b/targets/RT/USER/lte-uesoftmodem.c
@@ -110,11 +110,9 @@ pthread_mutex_t nfapi_sync_mutex;
 int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
 
 uint8_t nfapi_mode = 0;
-#ifdef PDCP_USE_NETLINK
 #ifdef UESIM_EXPANSION
 uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
 #endif
-#endif
 uint16_t sf_ahead=2;
 int tddflag;
 char *emul_iface;
@@ -685,11 +683,10 @@ int main( int argc, char **argv ) {
 #endif
   int CC_id;
   uint8_t  abstraction_flag=0;
-#ifdef PDCP_USE_NETLINK
-#ifdef UESIM_EXPANSION
-  memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
-#endif
+#ifdef UESIM_EXPANSION  
+    memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
 #endif
+
   // Default value for the number of UEs. It will hold,
   // if not changed from the command line option --num-ues
   NB_UE_INST=1;