Fixed some bugs in Vec class