Fixed up lineage end condition.
Fixed up leaf count end condition.