As we just discussed at IRC, let's put a check at the beginning of this method for nodes that are leaves (i.e. with `attribute_id == -1`) and this method should return directly in that case. Then this second part of the `&&` can be removed.