Bug fix in the snap to node feature