Fix slice overwriting.