diff --git a/Ccore/onelab_optimize.py b/Ccore/onelab_optimize.py
index 0ec1b8f8e862fc2c1d197e16f6a8184344e9cda9..e15cc02eda8b959a0713ad8d0398a4d82fbfa502 100644
--- a/Ccore/onelab_optimize.py
+++ b/Ccore/onelab_optimize.py
@@ -122,7 +122,10 @@ def Optimize(Optimizer):
             initialPoint[label] = var[1]
             lowerBound[label] = var[2]
             upperBound[label] = var[3]
-        
+
+        # Initialize conveks
+        conveks.initialize()
+
         # Initialize the MMA optimizer
         conveks.mma.initialize(initialPoint, lowerBound, upperBound)
 
@@ -170,9 +173,12 @@ def Optimize(Optimizer):
         print 'Converged: %4d %3.6f %3.6f %3.6f' %(it, obj, change_rel, change_mma),
         print xFromMMA, grad_obj
         
-        # This should be called at the end
+        # This should be called at the end of MMA
         conveks.mma.finalize()
 
+        # This should be called at the end 
+        conveks.finalize()
+
 def minimize(name):
     global x, modelName, file_geo, file_pro, file_msh, mygmsh, mygetdp, maxIter, maxChange
     modelName = name
diff --git a/Lbracket/topo.py b/Lbracket/topo.py
index 92dd5b24ea4f63cc536dd8ceb2c13e2f1590609b..1606aaeb653cc6e514a07c17f30457e1a85d95ff 100644
--- a/Lbracket/topo.py
+++ b/Lbracket/topo.py
@@ -87,6 +87,9 @@ lowerBound = 0.001*np.ones(numVariables)
 # upper bound for design variables (here all set to 1)
 upperBound = np.ones(numVariables)
 
+# Initialize conveks
+conveks.initialize()
+
 # Initialize the MMA optimizer
 conveks.mma.initialize(x, lowerBound, upperBound)
 
@@ -159,5 +162,8 @@ while change > maxChange and it <= maxIter and c.getString('topo/Action') != 'st
     change = conveks.mma.getDesignChange()
     it = conveks.mma.getOuterIteration()
 
-# This should be called at the end
+# This should be called at the end of MMA
 conveks.mma.finalize()
+
+# This should be called at the end
+conveks.finalize()
\ No newline at end of file
diff --git a/Team25/shape.py b/Team25/shape.py
index 70b1dbf0e9cf8dd5edbc0ac95d068eb08d60e7cc..310805d381998a5e4ad26cbb38d7b52544bc2ea8 100644
--- a/Team25/shape.py
+++ b/Team25/shape.py
@@ -101,6 +101,9 @@ for label, var in x.iteritems():
   lowerBound[label] = var[2]
   upperBound[label] = var[3]
 
+# Initialize conveks
+conveks.initialize()
+
 # Initialize the MMA optimizer
 conveks.mma.initialize(initialPoint, lowerBound, upperBound)
 
@@ -159,5 +162,8 @@ while it <= maxIter and c.getString('shape/Action') != 'stop':
     change = conveks.mma.getDesignChange()
     it = conveks.mma.getOuterIteration()
 
-# This should be called at the end
+# This should be called at the end of MMA
 conveks.mma.finalize()
+
+# This should be called at the end
+conveks.finalize()
\ No newline at end of file