Fix erasing all elements in a vector