Deal with leaf nodes