Remove out-of-bound access to vectors.

The following code is illegal:

```
std::vector<*> v;
// **
&v[v.size()];
```