Fixed state reset on err