Error message in incomplete markets model

I am trying to replicate an incomplete markets model. I have tripled checked the equations and everything seems to be fine. Nevertheless, I obtain an error message from inside dynare.

It is known that these models policy function do have an unit root. Moreover, there are multiple steady states. I am telling dynare the steady state.
But either in the command check or stoch simul the following error message appears. (Sticky is the dyn file)

??? Subscript indices must either be real positive integers or logicals.

Error in ==> dr1 at 139
b = jacobia_(:,k0);

Error in ==> resol at 48
[dr,info] = dr1(dr,check_flag);

Error in ==> check at 18
[dr, info] = resol(ys_,1);

Error in ==> Sticky at 106

Error in ==> dynare at 26
evalin(‘base’,fname) ;

Please find enclosed a zip file containing the dyn file and the m file to compute steady state.

Best (1.49 KB)

Thanks to the help of Michel the problem was solved. There was a variable in the model that was mistakenly appearing at t-1 only.

quoting Michel
Note: I identified the problem by looking at global variable iy_ that tells which variable appears at which lag. The variables are ordered in alphabetical order."