Fix in pruning when undefined types are present.

If an inner node has undefined type and only rejecting
children, then pruning would have deleted all the rejecting children but
retained the undefined node, even though it would be discarded no matter
if it eventually became "or" or "and". In such cases it is now also
pruned.