diff --git a/ExprNode.cc b/ExprNode.cc
index 6a9f2fa850dd53c8d79a32ae79ac7ea7bbfb6dd7..ed7c2f64c952e040dc294cd265f68e4557469cf9 100644
--- a/ExprNode.cc
+++ b/ExprNode.cc
@@ -4686,6 +4686,8 @@ FirstDerivExternalFunctionNode::compileExternalFunctionOutput(ostream &CompileCo
       FCALL_ fcall(nb_output_arguments, nb_add_input_arguments, datatree.symbol_table.getName(first_deriv_symb_id), indx);
       fcall.set_function_type(ExternalFunctionFirstDerivative);
       fcall.write(CompileCode, instruction_number);
+      FSTPTEFD_ fstptefd(indx, inputIndex);
+      fstptefd.write(CompileCode, instruction_number);
     }
 }