Fixed infinite loop after exit.