This catches the case where an And/Or node has no children - can we have a comment that that's what it's for? Also, I'd prefer the more specific `if rule is not None`.