First order solves, second order won't

The attached code (a toy model starting to think about non-linear equations for probability of mortgage default) solves fine if I set order=1 but it won’t solve the second order approximation: this error, or something similar in later versions of Dynare… Any ideas?? thanks! David

.
??? Reference to non-existent field ‘ghs2’.

Error in ==> dr2 at 11
ghs2 = dr.ghs2;

Error in ==> dynare_solve at 41
fvec = feval(func,x,varargin{:});

Error in ==> resol at 55
dr.ys = dynare_solve(‘dr2’,ys,dr);

Error in ==> stoch_simul at 46
[dr_, info] = resol(ys_,0);

Error in ==> pd at 108
info=stoch_simul(var_list_);

Error in ==> dynare at 26
evalin(‘base’,fname) ;
pd.mod (555 Bytes)

the ghs2 issue is because there are no leads in the model.

When I added one it was happy to run in 2007a.

Note that (as others have commented) sometimes second order stochastic simulations result in an error namely

??? Invalid MEX-file ‘C:\data\matlab\dynare_v3o2\matlab\gensylv.dll’: The
specified procedure could not be found.

I am getting this with several examples in R2008a but R2007a seems to still work.