The x returned by a steady state file includes Lagrange multipliers. When starting with 0 multipliers, the steady state of the multipliers is computed correctly. But when running it a second time like in a subsequent call to stoch_simul, the algorithm thinks that elements of xx are 0 which they aren't. As a result, it finds minus the multiplier as the solution, resulting in an output of 0 for all multipliers.
Also makes sure that the check flag is returned and the steady state file always called if it exists. Otherwise, parameters might not be updated and NaN not detected.
If the steady state file was modifying parameters, the changes were not taken
fully taken into account.
Thanks to Junior Maih for noticing and proposing the fix.