Fix slice error for 2D data