Fix IndexOutOfBoundsException bug in TargetedCommand when you try to delete a range that exceeds the search result bounds