Overloaded operator[] for vectors.