diff --git a/hTensor.cabal b/hTensor.cabal
--- a/hTensor.cabal
+++ b/hTensor.cabal
@@ -1,5 +1,5 @@
 Name:               hTensor
-Version:            0.8.0
+Version:            0.8.1
 License:            GPL
 License-file:       LICENSE
 Author:             Alberto Ruiz
diff --git a/lib/Numeric/LinearAlgebra/Array/Internal.hs b/lib/Numeric/LinearAlgebra/Array/Internal.hs
--- a/lib/Numeric/LinearAlgebra/Array/Internal.hs
+++ b/lib/Numeric/LinearAlgebra/Array/Internal.hs
@@ -56,6 +56,7 @@
     firstIdx, fibers, matrixator, matrixatorFree,
     Coord,
     asMatrix, asVector, asScalar,
+    resetCoords,
     debug
 ) where
 
@@ -108,6 +109,12 @@
             then vec
             else error $ show ds ++ " dimensions and " ++
                          show (dim vec) ++ " coordinates for mkNArray"
+
+resetCoords :: Coord t => NArray i t -> Vector t -> NArray i t
+-- ^ change the whole set of coordinates.
+resetCoords (A dms u) v | dim u == dim v = A dms v
+                        | otherwise = error "wrong size in replaceCoords"
+
 
 -- | Create a 0-dimensional structure.
 scalar :: Coord t => t -> NArray i t
diff --git a/lib/Numeric/LinearAlgebra/Array/Solve.hs b/lib/Numeric/LinearAlgebra/Array/Solve.hs
--- a/lib/Numeric/LinearAlgebra/Array/Solve.hs
+++ b/lib/Numeric/LinearAlgebra/Array/Solve.hs
@@ -50,7 +50,7 @@
     na = namesR a \\ nx
     nb = namesR b \\ namesR a
     aM = g $ matrixator a na nx
-    bM = matrixator b na nb
+    bM = g $ matrixator b na nb
     xM = linearSolveSVD aM bM
     dx = map opos (selDims (dims a) nx) ++ selDims (dims b) nb
     x = mkNArray dx (flatten xM)
diff --git a/lib/Numeric/LinearAlgebra/Array/Util.hs b/lib/Numeric/LinearAlgebra/Array/Util.hs
--- a/lib/Numeric/LinearAlgebra/Array/Util.hs
+++ b/lib/Numeric/LinearAlgebra/Array/Util.hs
@@ -38,6 +38,7 @@
     atT, takeDiagT, diagT,
     mkFun, mkAssoc, setType,
     renameParts,
+    resetCoords,
     asScalar, asVector, asMatrix, applyAsMatrix,
     fibers, matrixator, matrixatorFree, analyzeProduct,
     fromVector, fromMatrix
