Fixed bug in restart