diff --git a/mex/sources/bytecode/ErrorHandling.hh b/mex/sources/bytecode/ErrorHandling.hh
index c0d6dc5eafd571f94d825c1eeb1557b31e6aba12..b5f8de2ce000305dc737019b826a733812595f6d 100644
--- a/mex/sources/bytecode/ErrorHandling.hh
+++ b/mex/sources/bytecode/ErrorHandling.hh
@@ -627,7 +627,7 @@ protected:
                   auto [arg3, prec_arg3, op_arg3] {Stack.top()};
                   Stack.pop();
                   Stack.emplace((it_code == faulty_op ? "{PowerDeriv}(" : "PowerDeriv(") + arg1
-                                + ", " + arg2 + ", " + arg2 + ")", 100, nullopt);
+                                + ", " + arg2 + ", " + arg3 + ")", 100, nullopt);
                 }
               else
                 {