Fixed bug on restarts.