minor cleanups. Fix off-by-one in accounting the number of nodes when the