Fixed template specialization in num_nodes.

Now respect const correctness
Now browsing the statement correctly