Add extra check to mapDepth, to prevent invalid push-rearrange.
Fix consumption of input in shape slices.