Added restart and fixed crash on exit.