fix slice function

the length property of returned value from slice function was wrong if start > 0