diff --git a/NonLinearSolver/modelReduction/DeepMaterialNetworks.cpp b/NonLinearSolver/modelReduction/DeepMaterialNetworks.cpp
index f990a778e668bef24ede8b27b4dcd6cf303e30f3..07fbc4265ce7d72423706d7cd8549eac24c5aecd 100644
--- a/NonLinearSolver/modelReduction/DeepMaterialNetworks.cpp
+++ b/NonLinearSolver/modelReduction/DeepMaterialNetworks.cpp
@@ -3204,7 +3204,7 @@ void DeepMaterialNetwork::downscale(const STensor3& Fcur, STensor3& F,  const Tr
     double wChild = getWeight(node);
     int childOrder = node->childOrder;
     //
-    double f = wChild/wParent;
+   //double f = wChild/wParent;
     double fact = 1./wChild;
     
     /*
diff --git a/NonLinearSolver/modelReduction/Tree.cpp b/NonLinearSolver/modelReduction/Tree.cpp
index c41223e047ddbc16672e66e68d5e9120f2ac39b9..ed8d0a0e8ed4f125dac7a22c8804d6a51b0f1c53 100644
--- a/NonLinearSolver/modelReduction/Tree.cpp
+++ b/NonLinearSolver/modelReduction/Tree.cpp
@@ -971,7 +971,7 @@ int Tree::getNumberOfNodes() const
   return allNodes.size();
 };
 
-bool Tree::removeZeroLeaves(double tol)
+bool Tree::removeZeroLeaves(double tol, bool iteration)
 {
   bool ok = false;
   int maxInter = 100;
@@ -1122,6 +1122,11 @@ bool Tree::removeZeroLeaves(double tol)
         Msg::Exit(0);
       }
     };
+    
+    if (!iteration)
+    {
+      break;
+    }
   };
   return false;
 };
diff --git a/NonLinearSolver/modelReduction/Tree.h b/NonLinearSolver/modelReduction/Tree.h
index 5c280beb8890593b2ef0b0fe6ad72c6a8d366af5..e5d7abd6622e4ddd268951038980af00e6afd7ac 100644
--- a/NonLinearSolver/modelReduction/Tree.h
+++ b/NonLinearSolver/modelReduction/Tree.h
@@ -78,7 +78,7 @@ class Tree
     void printNodeFraction() const;
     
     bool removeLeavesWithZeroContribution(double tol=1e-6);
-    bool removeZeroLeaves(double tol);
+    bool removeZeroLeaves(double tol, bool iteration=true);
     bool treeMerging();
     
     #ifndef SWIG