diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c
index b6b1626c4b8c9b3c8ab82d693ec6ba09f38116a7..60921da1cb38194f63a914179f91509950e39fe0 100644
--- a/openair1/PHY/INIT/nr_init_ru.c
+++ b/openair1/PHY/INIT/nr_init_ru.c
@@ -22,6 +22,7 @@
 #include "phy_init.h"
 #include "SCHED/sched_common.h"
 #include "PHY/phy_extern.h"
+#include "PHY/NR_TRANSPORT/nr_transport.h"
 #include "SIMULATION/TOOLS/sim.h"
 /*#include "RadioResourceConfigCommonSIB.h"
 #include "RadioResourceConfigDedicated.h"
diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach.c b/openair1/PHY/NR_TRANSPORT/nr_prach.c
index 6e166257377f4ad166fc4d20d8438e20b8dc8f4f..3a90bd312b50f7cabb0e86badbb88e4015789d2f 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_prach.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_prach.c
@@ -278,8 +278,10 @@ void rx_nr_prach_ru(RU_t *ru,
 	//50 MHz @ 61.44 Ms/s
 	prach2 = prach[aa] + (Ncp<<2);
 	if (prach_sequence_length == 0) {
-	  if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2)
+	  if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
+            dftlen=49152;
 	    dft49152(prach2,rxsigF[aa],1);
+          }
 	  if (prach_fmt == 1 || prach_fmt == 2) {
 	    dft49152(prach2+98304,rxsigF[aa]+98304,1);
 	    reps++;
@@ -290,11 +292,13 @@ void rx_nr_prach_ru(RU_t *ru,
 	    reps+=2;
 	  }
 	  if (prach_fmt == 3) { 
+            dftlen=12288;
 	    for (int i=0;i<4;i++) dft12288(prach2+(i*12288*2),rxsigF[aa]+(i*12288*2),1);
 	    reps=4;
 	  }
 	}
 	else {
+          dftlen=2048;
 	  dft2048(prach2,rxsigF[aa],1);
 	  if (prach_fmt != 7) { // !=C0
 	    dft2048(prach2+4096,rxsigF[aa]+4096,1);
@@ -317,10 +321,11 @@ void rx_nr_prach_ru(RU_t *ru,
 	}
       } else {
 	//	40 MHz @ 46.08 Ms/s
+        prach2 = prach[aa] + (3*Ncp);
 	if (prach_sequence_length == 0) {
-	  prach2 = prach[aa] + (3*Ncp);
 	  AssertFatal(fp->N_RB_UL <= 107,"cannot do 108..136 PRBs with 3/4 sampling\n");
 	  if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
+            dftlen=36864;
 	    dft36864(prach2,rxsigF[aa],1);
 	    reps++;
 	  }
@@ -334,10 +339,12 @@ void rx_nr_prach_ru(RU_t *ru,
 	    reps+=2;
 	  }
 	  if (prach_fmt == 3) {
+            dftlen=9216;
 	    for (int i=0;i<4;i++) dft9216(prach2+(i*9216*2),rxsigF[aa]+(i*9216*2),1);
 	    reps=4;
 	  }
 	} else {
+          dftlen=1536;
 	  dft1536(prach2,rxsigF[aa],1);
 	  if (prach_fmt != 0xc0) {
 	    dft1536(prach2+3072,rxsigF[aa]+3072,1);
@@ -364,12 +371,13 @@ void rx_nr_prach_ru(RU_t *ru,
     else if (fp->N_RB_UL <= 273) {
       if (fp->threequarter_fs==0) {
 	prach2 = prach[aa] + (Ncp<<3); 
-	dftlen=98304;
 	//80,90,100 MHz @ 122.88 Ms/s 
 
 	if (prach_sequence_length == 0) {	
-	  if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2)
+	  if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
+	    dftlen=98304;
 	    dft98304(prach2,rxsigF[aa],1);
+          }
 	  if (prach_fmt == 1 || prach_fmt == 2) {
 	    dft98304(prach2+196608,rxsigF[aa]+196608,1);
 	    reps++;
@@ -380,9 +388,9 @@ void rx_nr_prach_ru(RU_t *ru,
 	    reps+=2;
 	  }
 	  if (prach_fmt == 3) {
+            dftlen=24576;
 	    for (int i=0;i<4;i++) dft24576(prach2+(i*2*24576),rxsigF[aa]+(i*2*24576),1);
 	    reps=4;
-	    dftlen=24576;
 	  }
 	}
 	else {
@@ -412,9 +420,9 @@ void rx_nr_prach_ru(RU_t *ru,
 	AssertFatal(fp->N_RB_UL <= 217,"cannot do more than 217 PRBs with 3/4 sampling\n");
 	prach2 = prach[aa] + (6*Ncp);
 	//	80 MHz @ 92.16 Ms/s
-	dftlen=73728;
 	if (prach_sequence_length == 0) {
 	  if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
+	    dftlen=73728;
 	    dft73728(prach2,rxsigF[aa],1);
 	    reps++;
 	  }
@@ -423,9 +431,9 @@ void rx_nr_prach_ru(RU_t *ru,
 	    reps++;
 	  }
 	  if (prach_fmt == 3) {
+	    dftlen=18432;
 	    for (int i=0;i<4;i++) dft18432(prach2+(i*2*18432),rxsigF[aa]+(i*2*18432),1);
 	    reps=4;
-	    dftlen=18432;
 	  }
 	} else {
 	  dftlen=3072;
diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c
index acb86f411fdc5ebfc59afadc245f19fc6d53702a..6954bce497ad8acf6e0966029c652456364f06d3 100644
--- a/openair2/LAYER2/NR_MAC_gNB/config.c
+++ b/openair2/LAYER2/NR_MAC_gNB/config.c
@@ -213,10 +213,10 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
     //cfg->prach_config.num_prach_fd_occasions_list[i].num_unused_root_sequences.value = ???
   }
 
-  cfg->prach_config.ssb_per_rach.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
+  cfg->prach_config.ssb_per_rach.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present-1;
   cfg->prach_config.ssb_per_rach.tl.tag = NFAPI_NR_CONFIG_SSB_PER_RACH_TAG;
   cfg->num_tlv++;
- 
+
   // SSB Table Configuration
   int scs_scaling = 1<<(cfg->ssb_config.scs_common.value);
   if (scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000)
diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c
index c938b968b6110f780bd016805308e583a3b4f0d6..18fc3d7e7caad72f4fdef30cf68214b07e727c6b 100644
--- a/openair2/RRC/NR/rrc_gNB_nsa.c
+++ b/openair2/RRC/NR/rrc_gNB_nsa.c
@@ -131,6 +131,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
   NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config));
   memset((void*)CG_Config,0,sizeof(*CG_Config));
   //int CG_Config_size = generate_CG_Config(rrc,CG_Config,ue_context_p->ue_context.reconfig,ue_context_p->ue_context.rb_config);
+  generate_CG_Config(rrc,CG_Config,ue_context_p->ue_context.reconfig,ue_context_p->ue_context.rb_config);
 
   //X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = CG_Config_size; //Need to verify correct value for the buffer_size
   // Send to X2 entity to transport to MeNB
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf
index 1363be3bce6962951e61ac96f7adf74c97e24466..d5bc492644ce6466e5f8a5f25aab4c9f52842b91 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf
@@ -105,8 +105,8 @@ gNBs =
 #1,2,4,8,10,20,40,80
         ra_ResponseWindow                                           = 4;
 #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
-#0=oneeighth,1=onefourth,2=half,3=one,4=two,5=four,6=eight,7=sixteen
-        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 3;
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 4;
 #oneHalf (0..15) 4,8,12,16,...60,64
         ssb_perRACH_OccasionAndCB_PreamblesPerSSB                   = 15;
 #ra_ContentionResolutionTimer
@@ -114,8 +114,8 @@ gNBs =
         ra_ContentionResolutionTimer                                = 7;
         rsrp_ThresholdSSB                                           = 19;
 #prach-RootSequenceIndex_PR
-#0 = 839, 1 = 139
-        prach_RootSequenceIndex_PR                                  = 1;
+#1 = 839, 2 = 139
+        prach_RootSequenceIndex_PR                                  = 2;
         prach_RootSequenceIndex                                     = 1;
         # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
         #  
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf
index 1fbc8e30ef27fd9db09c4ee06057670e6d03308a..93a6c7fbc92ee18b71e592a0a0dd31e0ddaba260 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf
@@ -105,8 +105,8 @@ gNBs =
 #1,2,4,8,10,20,40,80
         ra_ResponseWindow                                           = 4;
 #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
-#0=oneeighth,1=onefourth,2=half,3=one,4=two,5=four,6=eight,7=sixteen
-        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 3;
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 4;
 #oneHalf (0..15) 4,8,12,16,...60,64
         ssb_perRACH_OccasionAndCB_PreamblesPerSSB                   = 15;
 #ra_ContentionResolutionTimer
@@ -114,8 +114,8 @@ gNBs =
         ra_ContentionResolutionTimer                                = 7;
         rsrp_ThresholdSSB                                           = 19;
 #prach-RootSequenceIndex_PR
-#0 = 839, 1 = 139
-        prach_RootSequenceIndex_PR                                  = 1;
+#1 = 839, 2 = 139
+        prach_RootSequenceIndex_PR                                  = 2;
         prach_RootSequenceIndex                                     = 1;
         # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
         #  
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf
index b82c455ef4359f04720dd853de6c0ff87fee5283..56233555c0d8117ae9e1b1875247ada4f763b62a 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf
@@ -105,8 +105,8 @@ gNBs =
 #1,2,4,8,10,20,40,80
         ra_ResponseWindow                                           = 4;
 #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
-#0=oneeighth,1=onefourth,2=half,3=one,4=two,5=four,6=eight,7=sixteen
-        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 3;
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 4;
 #oneHalf (0..15) 4,8,12,16,...60,64
         ssb_perRACH_OccasionAndCB_PreamblesPerSSB                   = 15;
 #ra_ContentionResolutionTimer
@@ -114,8 +114,8 @@ gNBs =
         ra_ContentionResolutionTimer                                = 7;
         rsrp_ThresholdSSB                                           = 19;
 #prach-RootSequenceIndex_PR
-#0 = 839, 1 = 139
-        prach_RootSequenceIndex_PR                                  = 1;
+#1 = 839, 2 = 139
+        prach_RootSequenceIndex_PR                                  = 2;
         prach_RootSequenceIndex                                     = 1;
         # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
         #  
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf
index 4cbec5b86e7ecbb25b9c36abdd1d6aab20b716d9..ea896750067cc94bac756eee907998872ba029da 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf
@@ -105,8 +105,8 @@ gNBs =
 #1,2,4,8,10,20,40,80
         ra_ResponseWindow                                           = 4;
 #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
-#0=oneeighth,1=onefourth,2=half,3=one,4=two,5=four,6=eight,7=sixteen
-        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 3;
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 4;
 #oneHalf (0..15) 4,8,12,16,...60,64
         ssb_perRACH_OccasionAndCB_PreamblesPerSSB                   = 15;
 #ra_ContentionResolutionTimer
@@ -114,8 +114,8 @@ gNBs =
         ra_ContentionResolutionTimer                                = 7;
         rsrp_ThresholdSSB                                           = 19;
 #prach-RootSequenceIndex_PR
-#0 = 839, 1 = 139
-        prach_RootSequenceIndex_PR                                  = 1;
+#1 = 839, 2 = 139
+        prach_RootSequenceIndex_PR                                  = 2;
         prach_RootSequenceIndex                                     = 1;
         # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
         #  
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf
index f5e2298a9971243481be25ea9a7260d419ac1172..5c84d9879b46ae2a98551860cfae7b4031646a0f 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf
@@ -105,8 +105,8 @@ gNBs =
 #1,2,4,8,10,20,40,80
         ra_ResponseWindow                                           = 4;
 #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
-#0=oneeighth,1=onefourth,2=half,3=one,4=two,5=four,6=eight,7=sixteen
-        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 3;
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+        ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR                = 4;
 #oneHalf (0..15) 4,8,12,16,...60,64
         ssb_perRACH_OccasionAndCB_PreamblesPerSSB                   = 15;
 #ra_ContentionResolutionTimer
@@ -114,8 +114,8 @@ gNBs =
         ra_ContentionResolutionTimer                                = 7;
         rsrp_ThresholdSSB                                           = 19;
 #prach-RootSequenceIndex_PR
-#0 = 839, 1 = 139
-        prach_RootSequenceIndex_PR                                  = 1;
+#1 = 839, 2 = 139
+        prach_RootSequenceIndex_PR                                  = 2;
         prach_RootSequenceIndex                                     = 1;
         # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
         #