Code not working and not sure why

Hi, I’m new to Dynaexample.mod (896 Bytes) re. I’m using it to solve an RBC model with King-Plosser-Rebelo type preferences. The code works if I set “gamma” (risk aversion parameter) to 1, but it doesn’t work for other values of gamma.

Attached is the code. I’ve tried all sorts of things but it still gives the error. Any help is appreciated!

Are you sure

exp(w)/exp(c) = xi*(1-exp(n))^(-1);

is correct? It looks only valid for separable utility.