Vector test code, minor fixes