Added additional fix for ambiguous names in trees. Also applies to #2.