Fix bug in the snap to node feature