Fixing bugs in the vector class