Prevent out-of-range vector access

Windows crashes if you try to access the address of an element outside
the range of the vector size. So if the size is n, &vec[n] will crash
(the last element is vec[n-1]). This also applies to accessing &vec[0]
on an empty vector. GCC will return NULL, but Windows will crash (at
least with Visual Studio 2008).