VQ and CSL fix (double projections)

Fixes removing the double edges for VQ and CSL.
Also, prevented copying of whole data in functions using
pass-by-reference.