Removed unnecessary copying of vectors.