diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc
index 21224cee0d0554b8de1a3490865d2bf289abc8fc..5d9fd4e6569e916485259c79fcd0ba2d2e4d2d5f 100644
--- a/src/ComputingTasks.cc
+++ b/src/ComputingTasks.cc
@@ -4946,7 +4946,7 @@ MethodOfMomentsStatement::writeOutput(ostream &output, const string &basename, b
       it != options_list.string_options.end())
     output << "options_.graph_format = '" << it->second << "';" << endl;
 
-  output << "[oo_, options_mom_] = method_of_moments(bayestopt_, options_, oo_, estim_params_, M_, matched_moments_, options_mom_);" << endl;  
+  output << "[oo_, options_mom_, M_] = method_of_moments(bayestopt_, options_, oo_, estim_params_, M_, matched_moments_, options_mom_);" << endl;  
 }
 
 void