Fixes a bug that occurs when the size of an empty vector is increased to set a value at index 0.
Fixes #4036 (closed)