diff --git a/patches/namd-2.12.diff b/patches/namd-2.12.diff
index f24360157cbc5135ddfce9e69304306a3e687d59..24dbb31e66889fda1c91a413adbf68be3e4bffe0 100644
--- a/patches/namd-2.12.diff
+++ b/patches/namd-2.12.diff
@@ -1,42 +1,39 @@
 patch -u -l -b -F 5 -N --suffix=.preplumed "./Makefile" << \EOF_EOF
 --- ./Makefile.preplumed
 +++ ./Makefile
-@@ -359,13 +359,15 @@
- CXXBASEFLAGS = $(COPTI)$(CHARMINC) $(COPTI)$(SRCDIR) $(COPTI)$(INCDIR) $(DPMTA) $(DPME) $(FMM) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN $(TCL) $(PYTHON) $(FFT) $(CUDA) $(MIC) $(MEMOPT) $(CCS) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF) $(EXTRAINCS) $(MSA) $(CKLOOP)
+@@ -439,10 +439,15 @@
  CXXFLAGS = $(CXXBASEFLAGS) $(CXXOPTS)
  CXXMICFLAGS = $(CXXBASEFLAGS) $(CXXOPTS) $(CXXMICOPTS)
  CXXTHREADFLAGS = $(CXXBASEFLAGS) $(CXXTHREADOPTS)
  CXXSIMPARAMFLAGS = $(CXXBASEFLAGS) $(CXXSIMPARAMOPTS)
  CXXNOALIASFLAGS = $(CXXBASEFLAGS) $(CXXNOALIASOPTS)
 +include .rootdir/Plumed.inc
++PLUMED_PREFIX=-Wl,
++PLUMED_LOAD1=$(patsubst "%.so",$(PLUMED_PREFIX)"%.so",$(PLUMED_LOAD))
++PLUMED_LOAD2=$(patsubst "%.dylib",$(PLUMED_PREFIX)"%.dylib",$(PLUMED_LOAD1))
 +
  CXXCOLVARFLAGS = $(CXXBASEFLAGS) $(CXXCOLVAROPTS)
  GXXFLAGS = $(CXXBASEFLAGS) -DNO_STRSTREAM_H
  CFLAGS = $(COPTI)$(SRCDIR) $(TCL) $(COPTS) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF)
  PLUGINGCCFLAGS = $(COPTI)$(PLUGINSRCDIR) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN
  PLUGINCFLAGS = $(PLUGINGCCFLAGS) $(COPTS)
- SBCFLAGS = $(COPTI)$(SBSRCDIR) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN -DPSFGEN_USEPLUGINS $(TCL) $(COPTS) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF)
- SBGCCFLAGS = $(COPTI)$(SBSRCDIR) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN -DPSFGEN_USEPLUGINS $(TCL) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF)
-@@ -394,13 +396,14 @@
-	$(CUDAOBJS) \
-	$(CUDALIB) \
-	$(DPMTALIB) \
-	$(DPMELIB) \
-	$(FMMLIB) \
-	$(TCLLIB) \
-+        $(PLUMED_LOAD) \
-	$(PYTHONLIB) \
-	$(FFTLIB) \
-	$(PLUGINLIB) \
-	$(SBLIB) \
-	$(CHARMOPTS) \
-	$(EXTRALINKLIBS) \
-	-lm -o namd2
+@@ -479,10 +484,11 @@
+ 	$(CUDALIB) \
+ 	$(DPMTALIB) \
+ 	$(DPMELIB) \
+ 	$(FMMLIB) \
+ 	$(TCLLIB) \
++        $(PLUMED_LOAD2) \
+ 	$(PYTHONLIB) \
+ 	$(FFTLIB) \
+ 	$(PLUGINLIB) \
+ 	$(SBLIB) \
+ 	$(CHARMOPTS) \
 EOF_EOF
-patch -u -l -b -F 5 --suffix=.preplumed "./src/ComputeMgr.C" << \EOF_EOF
+patch -u -l -b -F 5 -N --suffix=.preplumed "./src/ComputeMgr.C" << \EOF_EOF
 --- ./src/ComputeMgr.C.preplumed
 +++ ./src/ComputeMgr.C
-@@ -80,12 +80,135 @@
+@@ -92,12 +92,135 @@
  #include "GlobalMasterSMD.h"
  #include "GlobalMasterTMD.h"
  #include "GlobalMasterSymmetry.h"
@@ -168,11 +165,11 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/ComputeMgr.C" << \EOF_EOF
 +  }
 +};
  
- ComputeMgr::ComputeMgr()
- {
-     CkpvAccess(BOCclass_group).computeMgr = thisgroup;
-     computeGlobalObject = 0;
-@@ -785,10 +908,15 @@
+ #include "ComputeNonbondedMICKernel.h"
+ 
+ #include "DeviceCUDA.h"
+ #ifdef NAMD_CUDA
+@@ -922,10 +1045,15 @@
              masterServerObject->addClient(new GlobalMasterSymmetry());    
          if (simParams->TMDOn)
              masterServerObject->addClient(new GlobalMasterTMD());
@@ -189,10 +186,10 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/ComputeMgr.C" << \EOF_EOF
  			masterServerObject->addClient(new GlobalMasterColvars());
  
 EOF_EOF
-patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.C" << \EOF_EOF
+patch -u -l -b -F 5 -N --suffix=.preplumed "./src/SimParameters.C" << \EOF_EOF
 --- ./src/SimParameters.C.preplumed
 +++ ./src/SimParameters.C
-@@ -1324,10 +1324,17 @@
+@@ -1603,10 +1603,17 @@
     opts.optionalB("main", "GBIS", "Use GB implicit solvent?",
        &GBISOn, FALSE);
     opts.optionalB("main", "GBISSer", "Use GB implicit solvent?",
@@ -210,21 +207,20 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.C" << \EOF_EOF
     opts.optional("GBIS", "intrinsicRadiusOffset",
        "Coulomb Radius Offset", &coulomb_radius_offset, 0.09);
     opts.optional("GBIS", "ionConcentration",
-@@ -4299,12 +4307,12 @@
-    }
-
+@@ -5128,11 +5135,11 @@
+    
     // Global forces configuration
-
+ 
     globalForcesOn = ( tclForcesOn || freeEnergyOn || miscForcesOn ||
                        (IMDon && ! IMDignore) || SMDOn || TMDOn || 
 -                      colvarsOn || symmetryOn || qmForcesOn );
 +                      colvarsOn || symmetryOn || qmForcesOn || plumedOn );
-
-
+ 
+ 
     if (tclForcesOn)
     {
       iout << iINFO << "TCL GLOBAL FORCES ACTIVE\n";
-@@ -4384,10 +4391,25 @@
+@@ -5213,10 +5220,25 @@
       }
  
       iout << endi;
@@ -251,10 +247,10 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.C" << \EOF_EOF
       iout << iINFO << "INTERACTIVE MD PORT    " << IMDport << "\n";
       iout << iINFO << "INTERACTIVE MD FREQ    " << IMDfreq << "\n";
 EOF_EOF
-patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.h" << \EOF_EOF
+patch -u -l -b -F 5 -N --suffix=.preplumed "./src/SimParameters.h" << \EOF_EOF
 --- ./src/SimParameters.h.preplumed
 +++ ./src/SimParameters.h
-@@ -430,10 +430,13 @@
+@@ -522,10 +522,13 @@
  	char tclBCArgs[128];		//  Extra args for calcforces command
  	Bool freeEnergyOn;		//  Doing free energy perturbation?
  	Bool miscForcesOn;		//  Using misc forces?
@@ -265,7 +261,7 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.h" << \EOF_EOF
 +
  	Bool fixedAtomsOn;		//  Are there fixed atoms?
  	Bool fixedAtomsForces;		//  Calculate forces anyway?
+ 	Bool fixedAtomsForceOutput; // Output fixed forces?
  
- 	Bool langevinOn;		//  Flag TRUE-> langevin dynamics active
- 	BigReal langevinTemp;		//  Temperature for Langevin dynamics
+ 	Bool langevinOnAtStartup;	//  Ensure that langevin is set up properly
 EOF_EOF
diff --git a/patches/namd-2.13.diff b/patches/namd-2.13.diff
index 656bd2c9fbccf5bf66f120d4f5f5674acb94cc6e..78a892e2d0fe0550a2af567cccf0b9895c1b2236 100644
--- a/patches/namd-2.13.diff
+++ b/patches/namd-2.13.diff
@@ -1,47 +1,39 @@
 patch -u -l -b -F 5 -N --suffix=.preplumed "./Makefile" << \EOF_EOF
 --- ./Makefile.preplumed
 +++ ./Makefile
-@@ -359,16 +359,18 @@
- CXXBASEFLAGS = $(COPTI)$(CHARMINC) $(COPTI)$(SRCDIR) $(COPTI)$(INCDIR) $(DPMTA) $(DPME) $(FMM) $(COPTI)$(PLUGININCDIR) $(COPTI)$(COLVARSINCDIR) $(COPTD)STATIC_PLUGIN $(TCL) $(PYTHON) $(FFT) $(CUDA) $(MIC) $(MEMOPT) $(CCS) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF) $(EXTRAINCS) $(MSA) $(CKLOOP)
+@@ -438,10 +438,15 @@
  CXXFLAGS = $(CXXBASEFLAGS) $(CXXOPTS)
  CXXMICFLAGS = $(CXXBASEFLAGS) $(CXXOPTS) $(CXXMICOPTS)
  CXXTHREADFLAGS = $(CXXBASEFLAGS) $(CXXTHREADOPTS)
  CXXSIMPARAMFLAGS = $(CXXBASEFLAGS) $(CXXSIMPARAMOPTS)
  CXXNOALIASFLAGS = $(CXXBASEFLAGS) $(CXXNOALIASOPTS)
 +include .rootdir/Plumed.inc
++PLUMED_PREFIX=-Wl,
++PLUMED_LOAD1=$(patsubst "%.so",$(PLUMED_PREFIX)"%.so",$(PLUMED_LOAD))
++PLUMED_LOAD2=$(patsubst "%.dylib",$(PLUMED_PREFIX)"%.dylib",$(PLUMED_LOAD1))
 +
  COLVARSCXXFLAGS = $(CXXBASEFLAGS) $(CXXCOLVAROPTS) $(COPTI)$(LEPTONINCDIR) -DLEPTON -DLEPTON_USE_STATIC_LIBRARIES
  GXXFLAGS = $(CXXBASEFLAGS) -DNO_STRSTREAM_H
  CFLAGS = $(COPTI)$(SRCDIR) $(TCL) $(COPTS) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF)
  PLUGINGCCFLAGS = $(COPTI)$(PLUGINSRCDIR) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN
  PLUGINCFLAGS = $(PLUGINGCCFLAGS) $(COPTS)
- SBCFLAGS = $(COPTI)$(SBSRCDIR) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN -DPSFGEN_USEPLUGINS $(TCL) $(COPTS) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF)
- SBGCCFLAGS = $(COPTI)$(SBSRCDIR) $(COPTI)$(PLUGININCDIR) $(COPTD)STATIC_PLUGIN -DPSFGEN_USEPLUGINS $(TCL) $(RELEASE) $(EXTRADEFINES) $(TRACEOBJDEF)
- COLVARSGXXFLAGS= $(GXXFLAGS)
- LEPTONGCCFLAGS= $(COPTI)$(LEPTONINCDIR)
- LEPTONCXXFLAGS=$(CXXBASEFLAGS) $(COPTI)$(LEPTONINCDIR) -DLEPTON_BUILDING_STATIC_LIBRARY
-@@ -394,15 +396,16 @@
-	$(CUDAOBJS) \
-	$(CUDALIB) \
-	$(DPMTALIB) \
-	$(DPMELIB) \
-	$(FMMLIB) \
-	$(TCLLIB) \
-+        $(PLUMED_LOAD) \
-	$(PYTHONLIB) \
-	$(FFTLIB) \
-	$(PLUGINLIB) \
-	$(SBLIB) \
-	$(COLVARSLIB) \
-	$(LEPTONOBJS) \
-	$(CHARMOPTS) \
-	$(EXTRALINKLIBS) \
-	$(MATHLIBS) -o namd2
+@@ -481,10 +486,11 @@
+ 	$(CUDALIB) \
+ 	$(DPMTALIB) \
+ 	$(DPMELIB) \
+ 	$(FMMLIB) \
+ 	$(TCLLIB) \
++        $(PLUMED_LOAD2) \
+ 	$(PYTHONLIB) \
+ 	$(FFTLIB) \
+ 	$(PLUGINLIB) \
+ 	$(SBLIB) \
+ 	$(COLVARSLIB) \
 EOF_EOF
-patch -u -l -b -F 5 --suffix=.preplumed "./src/ComputeMgr.C" << \EOF_EOF
+patch -u -l -b -F 5 -N --suffix=.preplumed "./src/ComputeMgr.C" << \EOF_EOF
 --- ./src/ComputeMgr.C.preplumed
 +++ ./src/ComputeMgr.C
-@@ -80,12 +80,135 @@
+@@ -92,12 +92,135 @@
  #include "GlobalMasterSMD.h"
  #include "GlobalMasterTMD.h"
  #include "GlobalMasterSymmetry.h"
@@ -173,11 +165,11 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/ComputeMgr.C" << \EOF_EOF
 +  }
 +};
  
- ComputeMgr::ComputeMgr()
- {
-     CkpvAccess(BOCclass_group).computeMgr = thisgroup;
-     computeGlobalObject = 0;
-@@ -785,10 +908,15 @@
+ #include "ComputeNonbondedMICKernel.h"
+ 
+ #include "DeviceCUDA.h"
+ #ifdef NAMD_CUDA
+@@ -1048,10 +1171,15 @@
              masterServerObject->addClient(new GlobalMasterSymmetry());    
          if (simParams->TMDOn)
              masterServerObject->addClient(new GlobalMasterTMD());
@@ -194,10 +186,10 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/ComputeMgr.C" << \EOF_EOF
  			masterServerObject->addClient(new GlobalMasterColvars());
  
 EOF_EOF
-patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.C" << \EOF_EOF
+patch -u -l -b -F 5 -N --suffix=.preplumed "./src/SimParameters.C" << \EOF_EOF
 --- ./src/SimParameters.C.preplumed
 +++ ./src/SimParameters.C
-@@ -1324,10 +1324,17 @@
+@@ -1778,10 +1778,17 @@
     opts.optionalB("main", "GBIS", "Use GB implicit solvent?",
        &GBISOn, FALSE);
     opts.optionalB("main", "GBISSer", "Use GB implicit solvent?",
@@ -215,21 +207,20 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.C" << \EOF_EOF
     opts.optional("GBIS", "intrinsicRadiusOffset",
        "Coulomb Radius Offset", &coulomb_radius_offset, 0.09);
     opts.optional("GBIS", "ionConcentration",
-@@ -4299,12 +4307,12 @@
-    }
-
+@@ -5447,11 +5454,11 @@
+    
     // Global forces configuration
-
+ 
     globalForcesOn = ( tclForcesOn || freeEnergyOn || miscForcesOn ||
-                       (IMDon && ! (IMDignore || IMDignoreForces)) || SMDOn || TMDOn ||
+                       (IMDon && ! (IMDignore || IMDignoreForces)) || SMDOn || TMDOn || 
 -                      colvarsOn || symmetryOn || qmForcesOn );
 +                      colvarsOn || symmetryOn || qmForcesOn || plumedOn );
-
-
+ 
+ 
     if (tclForcesOn)
     {
       iout << iINFO << "TCL GLOBAL FORCES ACTIVE\n";
-@@ -4384,10 +4391,25 @@
+@@ -5532,10 +5539,25 @@
       }
  
       iout << endi;
@@ -256,10 +247,10 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.C" << \EOF_EOF
       iout << iINFO << "INTERACTIVE MD PORT    " << IMDport << "\n";
       iout << iINFO << "INTERACTIVE MD FREQ    " << IMDfreq << "\n";
 EOF_EOF
-patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.h" << \EOF_EOF
+patch -u -l -b -F 5 -N --suffix=.preplumed "./src/SimParameters.h" << \EOF_EOF
 --- ./src/SimParameters.h.preplumed
 +++ ./src/SimParameters.h
-@@ -430,10 +430,13 @@
+@@ -547,10 +547,13 @@
  	char tclBCArgs[128];		//  Extra args for calcforces command
  	Bool freeEnergyOn;		//  Doing free energy perturbation?
  	Bool miscForcesOn;		//  Using misc forces?
@@ -270,7 +261,7 @@ patch -u -l -b -F 5 --suffix=.preplumed "./src/SimParameters.h" << \EOF_EOF
 +
  	Bool fixedAtomsOn;		//  Are there fixed atoms?
  	Bool fixedAtomsForces;		//  Calculate forces anyway?
+ 	Bool fixedAtomsForceOutput; // Output fixed forces?
  
- 	Bool langevinOn;		//  Flag TRUE-> langevin dynamics active
- 	BigReal langevinTemp;		//  Temperature for Langevin dynamics
+ 	Bool langevinOnAtStartup;	//  Ensure that langevin is set up properly
 EOF_EOF