diff --git a/include/aidge/operator/ReduceMean.hpp b/include/aidge/operator/ReduceMean.hpp
index df8cc22962ad2e09976438259adbde43fc911f13..5f07cddfa667e7e494defe38a5667332744c3e20 100644
--- a/include/aidge/operator/ReduceMean.hpp
+++ b/include/aidge/operator/ReduceMean.hpp
@@ -79,12 +79,12 @@ class ReduceMean_Op : public OperatorTensor,
                 if (val < 0)
                     val+=static_cast<std::int32_t>(getInput(0)->nbDims());
             });
-            std::sort(axes.cbegin(), axes.cend());
+            std::sort(axes.begin(), axes.end());
 
             // build output dimensions
             std::vector<DimSize_t> outDims = getInput(0)->dims();
             if (this->template getAttr<ReduceMeanAttr::KeepDims>()) {
-                std::for_each(axes.begin(), axes.end(), [&] (const std::int32_t& val) { outDims[val] = 1; });
+                std::for_each(axes.begin(), axes.end(), [&outDims] (const std::int32_t& val) { outDims[val] = 1; });
             }
             else {
                 for (auto it = axes.crbegin(); it != axes.crend(); ++it)