Fixed bugs in vector