Fix incorrect slicing