Fix segmentation fault with values[...] indices.