Improved the way to select the closest region when removing a cursor.