Fix crash when selected point is out of range due to previously deleting a point.