Optimize creation of vector matrix

Optimized the creation of a vector matrix by removing a table creation. Fixed a typo. Removed trailing whitespace.