diff --git a/src/TNL/Containers/Segments/Ellpack.h b/src/TNL/Containers/Segments/Ellpack.h
index c197c7010cb352ed10f773937665719455570b48..6edacb1cff9718cba91916e6de2ad3798b3143e0 100644
--- a/src/TNL/Containers/Segments/Ellpack.h
+++ b/src/TNL/Containers/Segments/Ellpack.h
@@ -34,7 +34,7 @@ class Ellpack
       using OffsetsHolder = Containers::Vector< IndexType, DeviceType, IndexType >;
       using SegmentsSizes = OffsetsHolder;
       template< typename Device_, typename Index_ >
-      using ViewTemplate = EllpackView< Device_, Index_ >;
+      using ViewTemplate = EllpackView< Device_, Index_, RowMajorOrder, Alignment >;
       using ViewType = EllpackView< Device, Index, RowMajorOrder, Alignment >;
       //using ConstViewType = EllpackView< Device, std::add_const_t< Index >, RowMajorOrder, Alignment >;
       using SegmentViewType = SegmentView< IndexType, RowMajorOrder >;
diff --git a/src/TNL/Containers/Segments/EllpackView.h b/src/TNL/Containers/Segments/EllpackView.h
index 3870f080280a8d3ac63d060ba2b402e40f48d432..dcbc56d1bad782f98c2c84ccac35310a45312465 100644
--- a/src/TNL/Containers/Segments/EllpackView.h
+++ b/src/TNL/Containers/Segments/EllpackView.h
@@ -35,7 +35,7 @@ class EllpackView
       using OffsetsHolder = Containers::Vector< IndexType, DeviceType, IndexType >;
       using SegmentsSizes = OffsetsHolder;
       template< typename Device_, typename Index_ >
-      using ViewTemplate = EllpackView< Device_, Index_ >;
+      using ViewTemplate = EllpackView< Device_, Index_, RowMajorOrder, Alignment >;
       using ViewType = EllpackView;
       using ConstViewType = EllpackView< Device, std::add_const_t< Index > >;
       using SegmentViewType = SegmentView< IndexType, RowMajorOrder >;
diff --git a/src/TNL/Containers/Segments/SlicedEllpack.h b/src/TNL/Containers/Segments/SlicedEllpack.h
index 5953cde3605148ebb268b098778973ae5d41eb4d..e1cdfa1d4d688a7783569a7296b8293760e854b0 100644
--- a/src/TNL/Containers/Segments/SlicedEllpack.h
+++ b/src/TNL/Containers/Segments/SlicedEllpack.h
@@ -35,7 +35,7 @@ class SlicedEllpack
       static constexpr bool getRowMajorOrder() { return RowMajorOrder; }
       using ViewType = SlicedEllpackView< Device, Index, RowMajorOrder, SliceSize >;
       template< typename Device_, typename Index_ >
-      using ViewTemplate = SlicedEllpackView< Device_, Index_ >;
+      using ViewTemplate = SlicedEllpackView< Device_, Index_, RowMajorOrder, SliceSize >;
       using ConstViewType = SlicedEllpackView< Device, std::add_const_t< Index >, RowMajorOrder, SliceSize >;
       using SegmentViewType = SegmentView< IndexType, RowMajorOrder >;
 
diff --git a/src/TNL/Containers/Segments/SlicedEllpackView.h b/src/TNL/Containers/Segments/SlicedEllpackView.h
index 2b310a805a5fc470522ca1baa038b5c7ab837395..23001553c6cd567aebc908705095119efedf8ac9 100644
--- a/src/TNL/Containers/Segments/SlicedEllpackView.h
+++ b/src/TNL/Containers/Segments/SlicedEllpackView.h
@@ -33,7 +33,7 @@ class SlicedEllpackView
       static constexpr int getSliceSize() { return SliceSize; }
       static constexpr bool getRowMajorOrder() { return RowMajorOrder; }
       template< typename Device_, typename Index_ >
-      using ViewTemplate = SlicedEllpackView< Device_, Index_ >;
+      using ViewTemplate = SlicedEllpackView< Device_, Index_, RowMajorOrder, SliceSize >;
       using ViewType = SlicedEllpackView;
       using ConstViewType = SlicedEllpackView< Device, std::add_const_t< Index > >;
       using SegmentViewType = SegmentView< IndexType, RowMajorOrder >;
diff --git a/src/TNL/Matrices/SparseMatrix.h b/src/TNL/Matrices/SparseMatrix.h
index 81422eef3b947d90dee7554785637c63e1e5c089..e31d9d6baf3ee8c0f5c04f2378a86f529219cbd0 100644
--- a/src/TNL/Matrices/SparseMatrix.h
+++ b/src/TNL/Matrices/SparseMatrix.h
@@ -40,6 +40,7 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator >
       using SegmentsType = Segments< Device, Index, IndexAllocator >;
       template< typename Device_, typename Index_ >
       using SegmentsViewTemplate = typename SegmentsType::template ViewTemplate< Device_, Index >;
+      using SegmentsViewType = typename SegmentsType::ViewType;
       using SegmentViewType = typename SegmentsType::SegmentViewType;
       using DeviceType = Device;
       using IndexType = Index;
diff --git a/src/TNL/Matrices/SparseMatrixView.h b/src/TNL/Matrices/SparseMatrixView.h
index a611b54670bd9c9f579bb415c73808188963f0aa..4fa65b70a09e7834aacac1ac80d74ee08c9e4ece 100644
--- a/src/TNL/Matrices/SparseMatrixView.h
+++ b/src/TNL/Matrices/SparseMatrixView.h
@@ -51,7 +51,6 @@ class SparseMatrixView : public MatrixView< Real, Device, Index >
       typedef Containers::VectorView< IndexType, DeviceType, IndexType > CompressedRowLengthsVectorView;
       typedef typename CompressedRowLengthsVectorView::ConstViewType ConstCompressedRowLengthsVectorView;
 
-
       __cuda_callable__
       SparseMatrixView();
 
@@ -103,8 +102,8 @@ class SparseMatrixView : public MatrixView< Real, Device, Index >
                        const RealType& value,
                        const RealType& thisElementMultiplicator = 1.0 );
 
-      RealType getElement( const IndexType row,
-                           const IndexType column ) const;
+      RealType getElement( IndexType row,
+                           IndexType column ) const;
 
       template< typename Vector >
       __cuda_callable__
diff --git a/src/TNL/Matrices/SparseMatrixView.hpp b/src/TNL/Matrices/SparseMatrixView.hpp
index cb6afd8e4538acdf3bd670794e166342c60cc75b..4e52448068bcd0ce3779b56ce04d02b0a3bb0237 100644
--- a/src/TNL/Matrices/SparseMatrixView.hpp
+++ b/src/TNL/Matrices/SparseMatrixView.hpp
@@ -209,6 +209,7 @@ SparseMatrixView< Real, Device, Index, MatrixType, SegmentsView >::
 getRow( const IndexType& rowIdx ) -> RowView
 {
    TNL_ASSERT_LT( rowIdx, this->getRows(), "Row index is larger than number of matrix rows." );
+   typename RowView::SegmentViewType t = this->segments.getSegmentView( rowIdx );
    return RowView( this->segments.getSegmentView( rowIdx ), this->values.getView(), this->columnIndexes.getView() );
 }