diff --git a/dumux/linear/matrixconverter.hh b/dumux/linear/matrixconverter.hh
index 087b4453f0a0c3928ee65b94f6eaa50cd71d5679..9d9efb34a7cdc7a027c608d8125ab6365ee4728a 100644
--- a/dumux/linear/matrixconverter.hh
+++ b/dumux/linear/matrixconverter.hh
@@ -98,10 +98,10 @@ private:
 
         // fill the pattern
         std::size_t rowIndex = 0;
-        Dune::Hybrid::forEach(A, [&addIndices, &rowIndex, &occupationPattern, numRows](const auto& rowOfMultiTypeMatrix)
+        Dune::Hybrid::forEach(A, [&addIndices, &rowIndex, numRows](const auto& rowOfMultiTypeMatrix)
         {
             std::size_t colIndex = 0;
-            Dune::Hybrid::forEach(rowOfMultiTypeMatrix, [&addIndices, &occupationPattern, &colIndex, &rowIndex, numRows](const auto& subMatrix)
+            Dune::Hybrid::forEach(rowOfMultiTypeMatrix, [&addIndices, &colIndex, &rowIndex, numRows](const auto& subMatrix)
             {
                 addIndices(subMatrix, rowIndex, colIndex);