Change splice operations to array slices, which
actually works.