trq-2507 Check for vector end after an erase so as not to step past the end of the vector.