Fix exit condition.