fixed bugs in vector generator