bug in resid.m that reset initial values when used after ENDVAL

resid shouldn't modify oo_ or any global variables

Maybe it should check against _static rather than _dynamic