Tree: support numeric id's.
Fixes #18279.