preprocessSlices function

Preprocess 'slices' argument.