tree-walk: use size_t consistently