More robust implementation of 'copy_vectors'