Fix restart->quit bug