Remove unnecessary array slicing.