Minor change to end condition.