diff --git a/algo/kf/core/geo/KfMaterialMap.cxx b/algo/kf/core/geo/KfMaterialMap.cxx
index 2307b2bcec769e0c40dd1a38721a03c88481f120..d247ba806db50e3a6618da301eaf455ca79eb845 100644
--- a/algo/kf/core/geo/KfMaterialMap.cxx
+++ b/algo/kf/core/geo/KfMaterialMap.cxx
@@ -59,20 +59,20 @@ void MaterialMap::Add(const MaterialMap& other, float zTarg)
   const auto stepSize{binSize / static_cast<float>(nRays)};             // Step between two neighboring rays [cm]
 
   // The coordinates of the first ray intersection with the other material layer [cm]
-  float xBinOther{-this->fXYmax * scaleFactor + stepSize * 0.5F};
-  float yBinOther{xBinOther};
+  float yBinOther{-this->fXYmax * scaleFactor + stepSize * 0.5F};
 
   // Loop over bins of the active (this)
   for (int iBinY{0}; iBinY < this->fNbins; ++iBinY) {
+    float xBinOther{-this->fXYmax * scaleFactor + stepSize * 0.5F};
     for (int iBinX{0}; iBinX < this->fNbins; ++iBinX) {
       // Collect material using ray shooting
       float avgThickness{0};  // Collected average thickness
       for (int iRayY{0}; iRayY < nRays; ++iRayY) {
         for (int iRayX{0}; iRayX < nRays; ++iRayX) {
-          avgThickness += other.GetThickness(xBinOther + iBinX * stepSize, yBinOther + iBinY * stepSize);
+          avgThickness += other.GetThicknessX0(xBinOther + iRayX * stepSize, yBinOther + iRayY * stepSize);
         }
       }
-      this->fTable[iBinX + this->fNbins * iBinY] += avgThickness / (nRays * nRays);
+      this->fTable[iBinX + this->fNbins * iBinY] += (avgThickness / (nRays * nRays));
       xBinOther += binSize;
     }
     yBinOther += binSize;
diff --git a/algo/kf/core/geo/KfModuleIndexMap.h b/algo/kf/core/geo/KfModuleIndexMap.h
index 66b1cdb489ce20246856b1f366aefd8d7dfecf38..2c54385cf766ea7393072a676d14e3c977650dae 100644
--- a/algo/kf/core/geo/KfModuleIndexMap.h
+++ b/algo/kf/core/geo/KfModuleIndexMap.h
@@ -147,7 +147,7 @@ namespace cbm::algo::kf
     }
 
     auto& iGlbDsbl = fvLocToGlb[fvDetLocOffset[iDetIntDsbl] + locIdDisable];
-    if (iGlbDsbl == -1) {
+    if (iGlbDsbl < 0) {
       return;  // Nothing to disable, component is already inactive
     }
 
diff --git a/algo/kf/core/geo/KfSetup.h b/algo/kf/core/geo/KfSetup.h
index 23823a4248a84528cdee001bf17c7528ad011df3..6789ab37ba0b866e39fa54a88e1a1b76e4ed8e6f 100644
--- a/algo/kf/core/geo/KfSetup.h
+++ b/algo/kf/core/geo/KfSetup.h
@@ -132,14 +132,12 @@ namespace cbm::algo::kf
   void Setup<T>::DisableLayer(EDetID iDet, int iLoc)
   {
     int iLayer{fModuleIndexMap.LocalToGlobal(iDet, iLoc)};
-    std::cout << "Disabling layer: iDet = " << static_cast<int>(iDet) << ", iLoc = " << iLoc << ", iLayer = " << iLayer << '\n';
     if (iLayer == -1) {
       return;
     }
 
     // Remove material layer and add it to the next one
     if (iLayer < static_cast<int>(fvMaterialLayers.size() - 1)) {
-      std::cout << " -- adding layer " << iLayer << " to layer " << iLayer + 1 << " with z = " << fvMaterialLayers[iLayer + 1].GetZref() << '\n';
       fvMaterialLayers[iLayer + 1].Add(fvMaterialLayers[iLayer], utils::simd::Cast<T, float>(fTarget.GetZ()));
     }
     fvMaterialLayers.erase(fvMaterialLayers.begin() + iLayer);