support out of range slice

note I got some process.nextTick warnings when I ran your tests, but it is not related to these changes.