Improve stop control script.