Fixed slicing bug with missing last index