Changed a loop break condition.