Fixed restart logic.