Fix engine stop routine