fix setIndex to include last item
Merge pull request #43 from EndangeredMassa/master

fix setIndex to include last item