Fix a bug that appears when there are no selected nodes.