Add endIndex
More asserts