Fix the node count sql