Updated vector code.

Fixes #7.
Fixes #8.

Minor corrections, futher documentation.