Eliminate num_nodes variable.