Fix for certain vector functions

Doesn't anyone check that stuff actually works before committing?
Merge pull request #328 from ArcticFqx/master

Fix for certain vector functions