Better index out of bounds detection.