fixed TreeNode.size() implementation