Hi Gregory,
My opinion is this:
the problem is on the error routine
( when a error occurs, VFP lost the reference to the this.Treeview, and the countObject it remains unchanged)
try with a variable:
private treeview,NodeExists
NodeExists = TRUE
treeview = m.this.Treeview
on error NodeExists = FALSE
=treeview.Nodes.Item(m.NodeName)
on error &sError
treeview = NULL
FABIO