resize() does not reset the existing values. Use assign instead to resest all of the vector's elements.