Better restart logic.