Fix index cache creation when there is only one cache value

We were potentially reading too far away...