fix leavesOf()