[bugfix] Use the size of the vector for the copying.

The last patch did not compile as there was no size member
in scope. Therefore this patch resorts to using the size of
the vector.