Add API documentation for vector, and fix some corner cases.