Improve sequence shrinking

Consider all elements in a sequence for removal when shrinking a
sequence. Previously, we only considered remove the first or last
element, in addition to shrinking the individual elements of the
sequence.