Fixed offset calculation for slice() call

Removed the reduction by 1 from the assignment of the 'end' value to pass correct offsets to slice()