 (defmacro ^:private transfer-matrix-vector [source destination]
   `(let [stor# (storage ~source)]
      (if (and (compatible? ~destination ~source) (.isGapless stor#))
-       (let [src# (view-vctr ~source)]
-         (copy (engine src#) src# ~destination))
+       (let [src-view# ^VectorSpace (view-vctr ~source)
+             n# (min (.dim src-view#) (.dim ~destination))]
+         (when (pos? n#)
+           (subcopy (engine src-view#) src-view# ~destination 0 n# 0)))
        (let [da# (real-accessor ~source)
              nav# (navigator ~source)
              reg# (region ~source)


(defmacro ^:private transfer-vector-vector [source destination]
  `(do
     (if (and (compatible? ~source ~destination) (fits? ~source ~destination))
       (copy! ~source ~destination)
       (dotimes [i# (min (.dim ~source) (.dim ~destination))]
         (.set ~destination i# (.entry ~source i#))))
     ~destination))

(defmacro ^:private transfer-vector-matrix [source destination]
  `(let [stor# (storage ~destination)]
     (if (and (compatible? ~source ~destination) (.isGapless stor#))
       (let [dst-view# ^VectorSpace (view-vctr ~destination)
             n# (min (.dim ~source) (.dim dst-view#))]
         (when (pos? n#)
           (subcopy (engine ~source) ~source dst-view# 0 n# 0)))
       (let [da# (real-accessor ~destination)
             nav# (navigator ~destination)
             reg# (region ~destination)
