Fix IOOB exception in indexToSlot when index is < 0.

Fixes #198.