diff --git a/src/Meshing/Mage.py b/src/Meshing/Mage.py
index cd4e577f8cd92160d5fb7489828b230d49680d9d..8cb59ba884588ce50d7cc04b3ea269e55cfe67f5 100644
--- a/src/Meshing/Mage.py
+++ b/src/Meshing/Mage.py
@@ -302,7 +302,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
 
         with tempfile.TemporaryDirectory() as tmp:
             logger.debug(f"temp file: {tmp}")
-            st_file = self.export_reach_to_st(reach, tmp)
+            st_file = self.export_reach_to_st(reach, "tmp")
             m_file = st_file.rsplit(".ST", 1)[0] + ".M"
 
             os.sync()
diff --git a/src/Solver/Mage.py b/src/Solver/Mage.py
index f8b664fd7f586cc6380953ff46437b0382fe6d8a..bcb36a8834191b1c7657c61b60cbee036262b823 100644
--- a/src/Solver/Mage.py
+++ b/src/Solver/Mage.py
@@ -495,6 +495,9 @@ class Mage(CommandLineSolver):
                 if not hs.input_reach.is_enable():
                     continue
 
+                if not hs.enabled:
+                    continue
+
                 if hs.input_kp is None:
                     continue
 
@@ -510,25 +513,26 @@ class Mage(CommandLineSolver):
 
     def _export_SIN_bhs(self, study, sin_dict, hs, f):
         for bhs in hs.basic_structures:
-            reach_id = study.river.get_edge_id(hs.input_reach) + 1
-            param_str = ' '.join(
-                [
-                    f'{p:>10.3f}'
-                    for p in self._export_SIN_parameters(bhs)
-                ]
-            )
+            if bhs.enabled:
+                reach_id = study.river.get_edge_id(hs.input_reach) + 1
+                param_str = ' '.join(
+                    [
+                        f'{p:>10.3f}'
+                        for p in self._export_SIN_parameters(bhs)
+                    ]
+                )
 
-            name = bhs.name
-            if name == "":
-                name = f"HS_{bhs.id:>3}".replace(" ", "0")
-            else:
-                name = name.replace(" ", "_")
+                name = bhs.name
+                if name == "":
+                    name = f"HS_{bhs.id:>3}".replace(" ", "0")
+                else:
+                    name = name.replace(" ", "_")
 
-            f.write(
-                f"{sin_dict[bhs._type]} " +
-                f"{reach_id} {float(hs.input_kp):>12.3f} " +
-                f"{param_str} {name}\n"
-            )
+                f.write(
+                    f"{sin_dict[bhs._type]} " +
+                    f"{reach_id} {float(hs.input_kp):>12.3f} " +
+                    f"{param_str} {name}\n"
+                )
 
     def _export_SIN_parameters(self, bhs):
         res = [9999.999] * 5
diff --git a/src/View/HydraulicStructures/BasicHydraulicStructures/Window.py b/src/View/HydraulicStructures/BasicHydraulicStructures/Window.py
index 93ef8a37564ac4bcc9aee1eb07e84fa9288f574e..9a39f49c64749b995b3ac3733038ee0e720003b5 100644
--- a/src/View/HydraulicStructures/BasicHydraulicStructures/Window.py
+++ b/src/View/HydraulicStructures/BasicHydraulicStructures/Window.py
@@ -252,13 +252,14 @@ class BasicHydraulicStructuresWindow(PamhyrWindow):
             self._checkbox.setChecked(self._hs.basic_structure(row).enabled)
 
     def _set_basic_structure_state(self):
-        row = self.index_selected_row()
-
-        if row is not None:
-            self._table.enabled(
-                row,
-                self._checkbox.isChecked()
-            )
+        rows = self.index_selected_rows()
+        if len(rows) != 0:
+            for row in rows:
+                if row is not None:
+                    self._table.enabled(
+                        row,
+                        self._checkbox.isChecked()
+                    )
 
     def update(self):
         self._set_checkbox_state()
diff --git a/src/View/HydraulicStructures/Window.py b/src/View/HydraulicStructures/Window.py
index ff290d7a6e95ae127ad0ea8f2b7f7cbdaa598318..1c6af72c6803393728312dd9632352033a39da40 100644
--- a/src/View/HydraulicStructures/Window.py
+++ b/src/View/HydraulicStructures/Window.py
@@ -262,12 +262,14 @@ class HydraulicStructuresWindow(PamhyrWindow):
             self._checkbox.setChecked(self._hs_lst.get(row).enabled)
 
     def _set_structure_state(self):
-        row = self.index_selected_row()
-        if row is not None:
-            self._table.enabled(
-                row,
-                self._checkbox.isChecked()
-            )
+        rows = self.index_selected_rows()
+        if len(rows) != 0:
+            for row in rows:
+                if row is not None:
+                    self._table.enabled(
+                        row,
+                        self._checkbox.isChecked()
+                    )
 
     def update(self):
         self._set_checkbox_state()