Fixing run time exception: reference into empty vector  

Replacing it with more predictable behavior.
Not to split hears but would it be a bit more appropriate to use
```
&v.front()
instead of
&v[0]
```
Not that it matters, but since we are so big on style...