diff --git a/src/daqd/net_writer.cc b/src/daqd/net_writer.cc
index 08fe705e7a488155faf8aaa2258b143da948c0a0..32aa1844c396d75f2a62f181d8f7b970962c0578 100644
--- a/src/daqd/net_writer.cc
+++ b/src/daqd/net_writer.cc
@@ -929,11 +929,6 @@ net_writer_c::consumer( )
                 char* data = buffptr->block_ptr( nb );
                 for ( int i = 0; i < num_channels; i++ )
                 {
-                    printf( "Byteswap %s rate=%d type=%d\n",
-                            channels[ i ].name,
-                            channels[ i ].sample_rate,
-                            channels[ i ].data_type );
-
                     if ( channels[ i ].bps == 4 )
                     {
                         for ( int j = 0; j < channels[ i ].sample_rate; j++ )
diff --git a/src/epics/simLink/CDS_PARTS.mdl b/src/epics/simLink/CDS_PARTS.mdl
index 7047ff25b22590db7e3003e4e9e378a0d5070004..3f3c010ac0c13b15b772b7f821384dfd4d38feb6 100644
--- a/src/epics/simLink/CDS_PARTS.mdl
+++ b/src/epics/simLink/CDS_PARTS.mdl
@@ -2,10 +2,10 @@ Library {
   Name			  "CDS_PARTS"
   Version		  9.3
   SavedCharacterEncoding  "UTF-8"
+  LogicAnalyzerPlugin	  "on"
+  WebScopes_FoundationPlugin "on"
   DiagnosticSuppressor	  "on"
   SLCCPlugin		  "on"
-  WebScopes_FoundationPlugin "on"
-  LogicAnalyzerPlugin	  "on"
   NotesPlugin		  "on"
   LibraryType		  "BlockLibrary"
   EnableAccessToBaseWorkspace on
@@ -24,7 +24,7 @@ Library {
       $ObjectID		      2
       $ClassName	      "Simulink.WindowInfo"
       IsActive		      [1]
-      Location		      [729.0, 64.0, 1036.0, 877.0]
+      Location		      [2110.0, 146.0, 1036.0, 877.0]
       Object {
 	$PropName		"ModelBrowserInfo"
 	$ObjectID		3
@@ -48,10 +48,10 @@ Library {
 	$ClassName		"Simulink.EditorInfo"
 	IsActive		[1]
 	ViewObjType		"SimulinkSubsys"
-	LoadSaveID		"150"
-	Extents			[735.0, 687.0]
-	ZoomFactor		[1.5]
-	Offset			[-17.569047619048717, 227.907229427522]
+	LoadSaveID		"322"
+	Extents			[747.0, 703.0]
+	ZoomFactor		[1.25]
+	Offset			[-149.32091882185546, 229.24999999999994]
       }
       Object {
 	$PropName		"DockComponentsInfo"
@@ -68,15 +68,15 @@ Library {
 	Height			[480]
 	Minimized		"Unset"
       }
-      WindowState	      "AAAA/wAAAAD9AAAAAgAAAAAAAAD1AAAC8PwCAAAAA/sAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAA"
+      WindowState	      "AAAA/wAAAAD9AAAAAgAAAAAAAAD1AAAC+fwCAAAAA/sAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAA"
       "AAAAAAA+wAAABYARABvAGMAawBXAGkAZABnAGUAdAA0AAAAAAD/////AAAAAAAAAAD7AAAAUgBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0Ac"
-      "ABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQBAAAAQAAAAvAAAACAAP///wAAAAEAAAAAAAAAAPwCA"
+      "ABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQBAAAAOQAAAvkAAABiAP///wAAAAEAAAAAAAAAAPwCA"
       "AAAAfsAAABUAEcATABVAEUAMgA6AFAAcgBvAHAAZQByAHQAeQBJAG4AcwBwAGUAYwB0AG8AcgAvAFAAcgBvAHAAZQByAHQAeQAgAEkAbgBzAHAAZ"
-      "QBjAHQAbwByAAAAAAD/////AAABrAD///8AAAMFAAAC8AAAAAEAAAACAAAAAQAAAAL8AAAAAQAAAAIAAAAP/////wAAAAAA/////wAAAAAAAAAA/"
+      "QBjAHQAbwByAAAAAAD/////AAABrAD///8AAAMRAAAC+QAAAAEAAAACAAAAAQAAAAL8AAAAAQAAAAIAAAAP/////wAAAAAA/////wAAAAAAAAAA/"
       "////wEAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/"
-      "////wEAAACK/////wAAAAAAAAAA/////wEAAADy/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/"
-      "////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wEAAAFK/////wAAAAAAAAAA/"
-      "////wEAAAGB/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA"
+      "////wEAAACA/////wAAAAAAAAAA/////wEAAADo/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/"
+      "////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wEAAAE7/////wAAAAAAAAAA/"
+      "////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA"
     }
   }
   HideAutomaticNames	  on
@@ -86,9 +86,9 @@ Library {
   ModifiedByFormat	  "%<Auto>"
   LastModifiedBy	  "ezekiel.dohmen"
   ModifiedDateFormat	  "%<Auto>"
-  LastModifiedDate	  "Tue Apr 12 10:14:15 2022"
-  RTWModifiedTimeStamp	  571659248
-  ModelVersionFormat	  "1.%<AutoIncrement:404>"
+  LastModifiedDate	  "Tue May 31 15:00:36 2022"
+  RTWModifiedTimeStamp	  575910028
+  ModelVersionFormat	  "1.%<AutoIncrement:405>"
   SampleTimeColors	  off
   SampleTimeAnnotations	  off
   LibraryLinkDisplay	  "all"
@@ -1035,6 +1035,25 @@ Library {
     Block {
       BlockType		      Ground
     }
+    Block {
+      BlockType		      Inport
+      Port		      "1"
+      OutputFunctionCall      off
+      OutMin		      "[]"
+      OutMax		      "[]"
+      OutDataTypeStr	      "Inherit: auto"
+      LockScale		      off
+      BusOutputAsStruct	      off
+      Unit		      "inherit"
+      PortDimensions	      "-1"
+      VarSizeSig	      "Inherit"
+      SampleTime	      "-1"
+      SignalType	      "auto"
+      SamplingMode	      "auto"
+      LatchByDelayingOutsideSignal off
+      LatchInputForFeedbackSignals off
+      Interpolate	      on
+    }
     Block {
       BlockType		      Logic
       Operator		      "AND"
@@ -1067,6 +1086,29 @@ Library {
       BusObject		      "BusObject"
       NonVirtualBus	      off
     }
+    Block {
+      BlockType		      Outport
+      Port		      "1"
+      OutMin		      "[]"
+      OutMax		      "[]"
+      OutDataTypeStr	      "Inherit: auto"
+      LockScale		      off
+      BusOutputAsStruct	      off
+      Unit		      "inherit"
+      PortDimensions	      "-1"
+      VarSizeSig	      "Inherit"
+      SampleTime	      "-1"
+      SignalType	      "auto"
+      SamplingMode	      "auto"
+      EnsureOutportIsVirtual  off
+      SourceOfInitialOutputValue "Dialog"
+      OutputWhenDisabled      "held"
+      InitialOutput	      "[]"
+      MustResolveToSignalObject	off
+      OutputWhenUnConnected   off
+      OutputWhenUnconnectedValue "0"
+      VectorParamsAs1DForOutWhenUnconnected off
+    }
     Block {
       BlockType		      Product
       Inputs		      "2"
@@ -1192,7 +1234,7 @@ Library {
   }
   System {
     Name		    "CDS_PARTS"
-    Location		    [729, 64, 1765, 941]
+    Location		    [2110, 146, 3146, 1023]
     Open		    off
     PortBlocksUseCompactNotation off
     SetExecutionDomain	    off
@@ -1207,9 +1249,9 @@ Library {
     TiledPaperMargins	    [0.500000, 0.500000, 0.500000, 0.500000]
     TiledPageScale	    1
     ShowPageBoundaries	    off
-    ZoomFactor		    "100"
+    ZoomFactor		    "125"
     ReportName		    "simulink-default.rpt"
-    SIDHighWatermark	    "389"
+    SIDHighWatermark	    "392"
     SimulinkSubDomain	    "Simulink"
     Block {
       BlockType		      SubSystem
@@ -5047,8 +5089,8 @@ Library {
       RequestExecContextInheritance off
       System {
 	Name			"Osc/Phase"
-	Location		[729, 64, 1765, 941]
-	Open			on
+	Location		[2078, 203, 3114, 1080]
+	Open			off
 	PortBlocksUseCompactNotation off
 	SetExecutionDomain	off
 	ExecutionDomainType	"Deduce"
@@ -5979,8 +6021,8 @@ Library {
       RequestExecContextInheritance off
       System {
 	Name			"simLinkParts"
-	Location		[694, 249, 1730, 1296]
-	Open			off
+	Location		[2110, 146, 3146, 1023]
+	Open			on
 	PortBlocksUseCompactNotation off
 	SetExecutionDomain	off
 	ExecutionDomainType	"Deduce"
@@ -5994,7 +6036,7 @@ Library {
 	TiledPaperMargins	[0.500000, 0.500000, 0.500000, 0.500000]
 	TiledPageScale		1
 	ShowPageBoundaries	off
-	ZoomFactor		"100"
+	ZoomFactor		"125"
 	SimulinkSubDomain	"Simulink"
 	Block {
 	  BlockType		  Abs
@@ -6086,13 +6128,14 @@ Library {
 	  BackgroundColor	  "yellow"
 	  ShowName		  off
 	  AttributesFormatString  "%<Description>"
-	  LibraryVersion	  "1.281"
+	  LibraryVersion	  "1.453"
 	  UserDataPersistent	  on
 	  UserData		  "DataTag58"
 	  SourceBlock		  "simulink/Model-Wide\nUtilities/DocBlock"
 	  SourceType		  "DocBlock"
 	  SourceProductName	  "Simulink"
 	  SourceProductBaseCode	  "SL"
+	  ContentPreviewEnabled	  off
 	  DocumentType		  "Text"
 	}
 	Block {
@@ -6106,13 +6149,14 @@ Library {
 	  BackgroundColor	  "yellow"
 	  ShowName		  off
 	  AttributesFormatString  "%<Description>"
-	  LibraryVersion	  "1.281"
+	  LibraryVersion	  "1.453"
 	  UserDataPersistent	  on
 	  UserData		  "DataTag59"
 	  SourceBlock		  "simulink/Model-Wide\nUtilities/DocBlock"
 	  SourceType		  "DocBlock"
 	  SourceProductName	  "Simulink"
 	  SourceProductBaseCode	  "SL"
+	  ContentPreviewEnabled	  off
 	  DocumentType		  "Text"
 	}
 	Block {
@@ -6126,15 +6170,62 @@ Library {
 	  BackgroundColor	  "yellow"
 	  ShowName		  off
 	  AttributesFormatString  "%<Description>"
-	  LibraryVersion	  "1.281"
+	  LibraryVersion	  "1.453"
 	  UserDataPersistent	  on
 	  UserData		  "DataTag60"
 	  SourceBlock		  "simulink/Model-Wide\nUtilities/DocBlock"
 	  SourceType		  "DocBlock"
 	  SourceProductName	  "Simulink"
 	  SourceProductBaseCode	  "SL"
+	  ContentPreviewEnabled	  off
 	  DocumentType		  "Text"
 	}
+	Block {
+	  BlockType		  SubSystem
+	  Name			  "ExampleSubsystem"
+	  SID			  "390"
+	  Ports			  [1, 1]
+	  Position		  [10, 674, 110, 716]
+	  ZOrder		  1
+	  RequestExecContextInheritance	off
+	  ContentPreviewEnabled	  on
+	  System {
+	    Name		    "ExampleSubsystem"
+	    Location		    [2110, 146, 3146, 1023]
+	    Open		    off
+	    PortBlocksUseCompactNotation off
+	    SetExecutionDomain	    off
+	    ExecutionDomainType	    "Deduce"
+	    ModelBrowserVisibility  on
+	    ModelBrowserWidth	    200
+	    ScreenColor		    "white"
+	    PaperOrientation	    "landscape"
+	    PaperPositionMode	    "auto"
+	    PaperType		    "usletter"
+	    PaperUnits		    "inches"
+	    TiledPaperMargins	    [0.500000, 0.500000, 0.500000, 0.500000]
+	    TiledPageScale	    1
+	    ShowPageBoundaries	    off
+	    ZoomFactor		    "100"
+	    SimulinkSubDomain	    "Simulink"
+	    Block {
+	      BlockType		      Inport
+	      Name		      "input1"
+	      SID		      "391"
+	      Position		      [110, 103, 140, 117]
+	      ZOrder		      -1
+	      IconDisplay	      "Port number"
+	    }
+	    Block {
+	      BlockType		      Outport
+	      Name		      "output1"
+	      SID		      "392"
+	      Position		      [360, 103, 390, 117]
+	      ZOrder		      -2
+	      IconDisplay	      "Port number"
+	    }
+	  }
+	}
 	Block {
 	  BlockType		  Fcn
 	  Name			  "Fcn"
@@ -6238,6 +6329,12 @@ Library {
 	  LibraryVersion	  "1.2"
 	  SourceBlock		  "cdsSqrt/Subsystem"
 	  SourceType		  "SubSystem"
+	  ShowPortLabels	  "FromPortIcon"
+	  SystemSampleTime	  "-1"
+	  GeneratePreprocessorConditionals off
+	  AllowZeroVariantControls off
+	  PropagateVariantConditions off
+	  ContentPreviewEnabled	  off
 	}
 	Block {
 	  BlockType		  Saturate
@@ -6289,6 +6386,12 @@ Library {
 	  LibraryVersion	  "1.4"
 	  SourceBlock		  "cdsBitwise/Subsystem"
 	  SourceType		  "SubSystem"
+	  ShowPortLabels	  "FromPortIcon"
+	  SystemSampleTime	  "-1"
+	  GeneratePreprocessorConditionals off
+	  AllowZeroVariantControls off
+	  PropagateVariantConditions off
+	  ContentPreviewEnabled	  off
 	}
 	Annotation {
 	  SID			  "343"
diff --git a/src/epics/util/Makefile.kernel b/src/epics/util/Makefile.kernel
index 121633eac359ddff5137bb5ba194527fb6facfb5..a949ab6b350d81bacd088ba75c65ec148621aaa7 100644
--- a/src/epics/util/Makefile.kernel
+++ b/src/epics/util/Makefile.kernel
@@ -17,6 +17,12 @@ $(shell cp -rp $(RCG_SRC)/src/fe/ $(mkfile_dir)/src/)
 $(shell cp -rp $(RCG_SRC)/src/drv/ $(mkfile_dir)/src/)
 $(shell cp -rp $(RCG_SRC)/src/shmem/ $(mkfile_dir)/src/)
 
+# We always want to take these values from the below 
+# KernelVars.mk script and not the ENV
+undefine IOP_MODEL
+undefine BUILD_WITH_DOLPHIN
+
+
 # Include the generated make variables, written by
 # the feCodeGen.pl script.
 include $(mkfile_dir)/KernelVars.mk
diff --git a/src/epics/util/lib/Parser3.pm b/src/epics/util/lib/Parser3.pm
index ebaa59d72baa23302d91b1d789fc98bcca74fac1..e854a32a82266819f659b224ed1d42ed40cfb472 100644
--- a/src/epics/util/lib/Parser3.pm
+++ b/src/epics/util/lib/Parser3.pm
@@ -643,7 +643,7 @@ sub node_processing {
 		return 1; # Do not call this function on leaves, we already did that
 	} elsif ($block_type eq "Reference") {
                 if ($source_block =~ /cdsIPCx/) {
-                   if ($block_name !~ /[CGHKLMSX]\d\:/) {
+                   if ($block_name !~ /[A-Z]\d\:/) {
                       die "***ERROR: Signal name of IPCx module must include IFO: $block_name\n";
                    }
                 }
diff --git a/src/fe/controllerApp.c b/src/fe/controllerApp.c
index 782a483b00d7a924f02e2f0760bf9040a3ff7106..b18a103b44bb1faf8be7698081968bdd40a0c82d 100644
--- a/src/fe/controllerApp.c
+++ b/src/fe/controllerApp.c
@@ -36,7 +36,7 @@
 #include "modelRateInfo.h"
 #include "fm10Gen.h"
 #include "util/printl.h"
-
+#include "util/kernel/exit_signaling.h"
 #include "../fe/timing_common.h" //captureEocTiming
 #include "../fe/timing_kernel.h"
 
@@ -204,6 +204,8 @@ fe_start_controller( void )
     if ( initVars( pDsp[ 0 ], pDsp[ 0 ], dspCoeff, MAX_MODULES, pCoeff[ 0 ] ) )
     {
         pLocalEpics->epicsOutput.fe_status = FILT_INIT_ERROR;
+        wait_for_exit_signal();
+        atomic_set(&g_atom_has_exited, 1);
         return;
     }
 
@@ -243,6 +245,8 @@ fe_start_controller( void )
     {
         pLocalEpics->epicsOutput.fe_status = DAQ_INIT_ERROR;
         vmeDone = 1;
+        wait_for_exit_signal();
+        atomic_set(&g_atom_has_exited, 1);
         return;
     }
 #endif
@@ -287,6 +291,8 @@ fe_start_controller( void )
     if ( status )
     {
         pLocalEpics->epicsOutput.fe_status = DAC_INIT_ERROR;
+        wait_for_exit_signal();
+        atomic_set(&g_atom_has_exited, 1);
         return;
     }
 
@@ -385,6 +391,8 @@ fe_start_controller( void )
                 pLocalEpics->epicsOutput.diagWord |= ADC_TIMEOUT_ERR;
                 pLocalEpics->epicsOutput.fe_status = ADC_TO_ERROR;
                 deallocate_dac_channels( );
+                wait_for_exit_signal();
+                atomic_set(&g_atom_has_exited, 1);
                 return;
             }
 
@@ -497,7 +505,7 @@ fe_start_controller( void )
         // *****************************************************************
         /// \> Check if code exit is requested
         if ( cycleNum == MAX_MODULES )
-            vmeDone = stop_working_threads |
+            vmeDone =  atomic_read(&g_atom_should_exit) |
                 checkEpicsReset( cycleNum, (struct CDS_EPICS*)pLocalEpics );
         // *****************************************************************
 
@@ -673,5 +681,6 @@ fe_start_controller( void )
     deallocate_dac_channels( );
 
     /* System reset command received */
+    atomic_set(&g_atom_has_exited, 1);
     return;
 }
diff --git a/src/fe/controllerIop.c b/src/fe/controllerIop.c
index 259f7b166fb42abb8467d2954b61ae28c140c802..942d28f4343f0391de0067ab773a1b3c1a93d463 100644
--- a/src/fe/controllerIop.c
+++ b/src/fe/controllerIop.c
@@ -37,6 +37,7 @@
 #include "fm10Gen_types.h"
 #include "controller.h"
 #include "modelRateInfo.h"
+#include "util/kernel/exit_signaling.h"
 #include "drv/daqLib.h"
 #include "../fe/timing_kernel.h"
 #include "../fe/sync21pps.h"
@@ -256,6 +257,8 @@ fe_start_controller( void )
     {
         pLocalEpics->epicsOutput.fe_status = FILT_INIT_ERROR;
         fe_status_return = FILT_INIT_ERROR;
+        wait_for_exit_signal();
+        atomic_set(&g_atom_has_exited, 1);
         return;
     }
 
@@ -291,6 +294,8 @@ fe_start_controller( void )
         pLocalEpics->epicsOutput.fe_status = DAQ_INIT_ERROR;
         fe_status_return = DAQ_INIT_ERROR;
         vmeDone = 1;
+        wait_for_exit_signal();
+        atomic_set(&g_atom_has_exited, 1);
         return;
     }
 
@@ -619,7 +624,7 @@ fe_start_controller( void )
             pLocalEpics->epicsOutput.diagWord |= ADC_TIMEOUT_ERR;
             pLocalEpics->epicsOutput.fe_status = ADC_TO_ERROR;
             pLocalEpics->epicsOutput.epicsSync++;
-            stop_working_threads = 1;
+            atomic_set(&g_atom_should_exit, 1);
             vmeDone = 1;
             continue;
         }
@@ -631,7 +636,7 @@ fe_start_controller( void )
             feStatus |= adc_status_update( &adcinfo );
             pLocalEpics->epicsOutput.stateWord = FE_ERROR_ADC;
             pLocalEpics->epicsOutput.fe_status = CHAN_HOP_ERROR;
-            stop_working_threads = 1;
+            atomic_set(&g_atom_should_exit, 1);
             vmeDone = 1;
             pLocalEpics->epicsOutput.epicsSync++;
             continue;
@@ -884,7 +889,7 @@ fe_start_controller( void )
             // *****************************************************************
             /// \> Check if code exit is requested
             if ( cycleNum == MAX_MODULES )
-                vmeDone = stop_working_threads |
+                vmeDone = atomic_read(&g_atom_should_exit) |
                     checkEpicsReset( cycleNum, (struct CDS_EPICS*)pLocalEpics );
 
             // *****************************************************************
@@ -1249,5 +1254,6 @@ fe_start_controller( void )
     pLocalEpics->epicsOutput.cpuMeter = 0;
 
     /* System reset command received */
+    atomic_set(&g_atom_has_exited, 1);
     return;
 }
diff --git a/src/fe/moduleLoad.c b/src/fe/moduleLoad.c
index 573c7dfca2b229f5c74fdd4a71724508f28a0bd8..58d6b4f76cc3b4b1059683cc08d2a9c90fe49c0a 100644
--- a/src/fe/moduleLoad.c
+++ b/src/fe/moduleLoad.c
@@ -8,6 +8,8 @@
 #include "verify_card_count.h"
 #include "print_io_info.h"
 #include "util/printl.h"
+#include "util/timing.h"
+#include "util/kernel/exit_signaling.h"
 #include "drv/map.h" //mapPciModules()
 #include "drv/ligoPcieTiming.h"
 #include "../fe/verify_slots.h"
@@ -29,10 +31,18 @@ extern void  fe_start_controller( void );
 //
 // File function prototypes
 //
-void rt_fe_cleanup( void );
-int rt_fe_init( void );
+static void rt_fe_cleanup( void );
+static int rt_fe_init( void );
+
+//
+// Signaling variables for proper module shutdown logic
+atomic_t g_atom_should_exit = ATOMIC_INIT(0);
+atomic_t g_atom_has_exited = ATOMIC_INIT(0);
 
 
+//
+// This symbol is used to enforce the IOP model
+// is first loaded, before any app models
 #ifdef IOP_MODEL
 int need_to_load_IOP_first;
 EXPORT_SYMBOL( need_to_load_IOP_first );
@@ -55,14 +65,13 @@ static int  fe_start_controller_kthread( void * arg )
     fe_start_controller();
     return 0;
 }
-
 #endif //NO_CPU_SHUTDOWN
 
-// MAIN routine: Code starting point
+
+// Linux Module init: Code starting point
 // ****************************************************************
 /// Startup function for initialization of kernel module.
-int
-rt_fe_init( void )
+static int __init rt_fe_init( void )
 {
     int jj, kk; /// @param ii,jj,kk default loop counters
     int cards; /// @param cards Number of PCIe cards found on bus
@@ -85,7 +94,7 @@ rt_fe_init( void )
 
 #ifndef NO_CPU_SHUTDOWN
     /// Verify requested core is free.
-    if ( is_cpu_taken_by_rcg_model( CPUID ) )
+    if ( is_cpu_occupied( CPUID ) )
     {
         printl( KERN_ALERT "Error: CPU %d already taken\n", CPUID );
         return -1;
@@ -141,7 +150,6 @@ rt_fe_init( void )
     {
         pLocalEpics->epicsOutput.fe_status = IO_CARD_MAP_ERROR;
         rt_fe_cleanup( );
-        detach_shared_memory();
         return -5;
     }
 
@@ -151,7 +159,6 @@ rt_fe_init( void )
         printl( "" SYSTEM_NAME_STRING_LOWER
                 ": ERROR: No ADC cards found - exiting\n" );
         rt_fe_cleanup( );
-        detach_shared_memory();
         return -5;
     }
 
@@ -231,7 +238,6 @@ rt_fe_init( void )
         printl( "" SYSTEM_NAME_STRING_LOWER
                 ": ERROR: Exit on incorrect card count \n" );
         rt_fe_cleanup( );
-        detach_shared_memory();
         return -5;
     }
 #endif
@@ -262,7 +268,7 @@ rt_fe_init( void )
     printl( "" SYSTEM_NAME_STRING_LOWER ": Locking CPU core %d\n", CPUID );
 
     // The code runs on the disabled CPU
-    set_fe_code_idle( fe_start_controller, CPUID );
+    set_rt_callback( fe_start_controller, CPUID );
     msleep( 100 );
     rts_isolator_exec( CPUID );
 
@@ -270,40 +276,49 @@ rt_fe_init( void )
     return 0;
 }
 
+void wait_for_module_exit(void)
+{
+    uint64_t stop_sig_time_ns = getMonotonic_ns_utin64();
+    if( is_cpu_occupied(CPUID) )
+    {
+        set_rt_callback( 0, CPUID );
+        
+        // Wait for the module to signal that it has exited
+        while (atomic_read(&g_atom_has_exited) == 0)
+        {
+            msleep( 1 );
+        }
+
+        printl("It took %lld ms for the RT code to exit.\n",
+                 (getMonotonic_ns_utin64() - stop_sig_time_ns)/1000000);
+
+        set_rt_callback( 0, CPUID );
+        msleep( 1000 );
+
+        // Bring the CPU back up
+        rts_isolator_cleanup( CPUID );
+    }
+}
+
 /// Kernel module cleanup function
-void
-rt_fe_cleanup( void )
+static void __exit rt_fe_cleanup( void )
 {
-#ifndef NO_CPU_SHUTDOWN
-    /// Unset the code callback
-    set_fe_code_idle( 0, CPUID );
-#endif
 
-    // printl("Setting stop_working_threads to 1\n");
-    // Stop the code and wait
+    // Signal the model to stop
+    atomic_set(&g_atom_should_exit, 1);
+
 #ifdef NO_CPU_SHUTDOWN
     kthread_stop( sthread );
-#endif
-    stop_working_threads = 1;
     msleep( 1000 );
+#else
+    wait_for_module_exit();
+#endif
 
 #ifdef DOLPHIN_TEST
     /// Cleanup Dolphin card connections
     finish_dolphin( );
 #endif
 
-#ifndef NO_CPU_SHUTDOWN
-
-    /// Bring the CPU core back on line
-    // Unset the code callback
-    set_fe_code_idle( 0, CPUID );
-    // printll("Will bring back CPU %d\n", CPUID);
-    msleep( 1000 );
-    // Bring the CPU back up
-    rts_isolator_cleanup( CPUID );
-    msleep( 1000 );
-#endif
-
     // Print out any error messages from FE code on exit
     print_exit_messages( fe_status_return, fe_status_return_subcode, SYSTEM_NAME_STRING_LOWER );
     detach_shared_memory( );
diff --git a/src/gds/awgtpman/testpoint.c b/src/gds/awgtpman/testpoint.c
index 09d3a2df980f03b6cebd492abc28cabee78dbbe5..d046615ecd3b1c124afbe8cde6ca4e269cd54d18 100644
--- a/src/gds/awgtpman/testpoint.c
+++ b/src/gds/awgtpman/testpoint.c
@@ -11,6 +11,7 @@
 #include "dtt/gdserrmsg.h"
 #include "tconv.h"
 #include "testpoint_interface_v3.h"
+#include "testpoint.h"
 
 #if defined (_CONFIG_DYNAMIC)
 #include "confinfo.h"
diff --git a/src/include/fe.h b/src/include/fe.h
index a6df4d44d10d338684b1955e2d8396f74fd3588e..82a67cbc808ed9cd3c961b7bac7f82ffec787ce4 100644
--- a/src/include/fe.h
+++ b/src/include/fe.h
@@ -5,8 +5,11 @@
 #include "controllerko.h" //CDIO* Globals and tdsControl/tdsCount
 
 #include "modelRateInfo.h" ////CYCLE_PER_SECOND, FE_RATE
+#include "qnorm.h"
 #include "util/inlineMath.h"
 #include "util/timing.h"
+#include "util/random_bytes.h"
+#include "util/prng_xoroshiroPP.h"
 #include "fm10Gen.h"
 #include "tRamp.h"
 #include "isnan.h"
diff --git a/src/include/qnorm.h b/src/include/qnorm.h
index a3700d1ce30d699cd9ec38e7d076b62b7f698f44..97e0f5528f5a5a44e896bf08b1bb745a1d44b824 100644
--- a/src/include/qnorm.h
+++ b/src/include/qnorm.h
@@ -106,7 +106,7 @@
 #ifndef LIGO_QNORM_H
 #define LIGO_QNORM_H
 
-#include "inlineMath.h"
+#include "util/inlineMath.h"
 
 
 #define ML_POSINF   (1.0 / 0.0)
diff --git a/src/include/util/kernel/exit_signaling.h b/src/include/util/kernel/exit_signaling.h
new file mode 100644
index 0000000000000000000000000000000000000000..675b9c04f81bcabf2ea9edbe86cc7ddafd149832
--- /dev/null
+++ b/src/include/util/kernel/exit_signaling.h
@@ -0,0 +1,24 @@
+#ifndef LIGO_EXIT_SIGNALING_H
+#define LIGO_EXIT_SIGNALING_H
+
+#include <linux/types.h>
+#include <linux/delay.h>
+#include <linux/atomic.h>
+
+// Used to signal the model to exit, defined in fe/moduleLoad.c
+extern atomic_t g_atom_should_exit;
+// Used by fe_start_controller() (The model) to signal it has exited,
+// defined in fe/moduleLoad.c
+extern atomic_t g_atom_has_exited; 
+
+// When a model experiences a nonrecoverable error and needs to exit
+// we block execution with this function until the model is rmmod-ed
+static void wait_for_exit_signal(void)
+{
+    while(atomic_read(&g_atom_should_exit) == 0)
+    {
+    }
+}
+
+
+#endif //LIGO_EXIT_SIGNALING_H