Fixed bug in as_slices.