Added support for 3D and 4D vectors.