Tweaks for wrong memoizing with state or stobjs.