diff --git a/src/core/tnlAssert.h b/src/core/tnlAssert.h
index 7489fccc621d45968c4a6dae730611b66c52a5c2..2c0fbaaf61da69ffa6e89b044c6b9615e457cc6c 100644
--- a/src/core/tnlAssert.h
+++ b/src/core/tnlAssert.h
@@ -7,7 +7,7 @@
 
 #ifndef TNLASSERT_H_
 
-#ifdef DEBUG
+#ifndef NDEBUG
 
 #include <iostream>
 #include <stdlib.h>
diff --git a/src/implementation/core/tnlMultiArray2D_impl.h b/src/implementation/core/tnlMultiArray2D_impl.h
index b15153e14f3a9962a5c07f3e110d617283a005f9..83792229b1dea189e7c7ee266c457e740bf69320 100644
--- a/src/implementation/core/tnlMultiArray2D_impl.h
+++ b/src/implementation/core/tnlMultiArray2D_impl.h
@@ -50,7 +50,7 @@ template< typename Element, typename Device, typename Index >
 bool tnlMultiArray< 2, Element, Device, Index > :: setDimensions( const Index jSize,
                                                                   const Index iSize )
 {
-   tnlAssert( xSize > 0 && ySize > 0,
+   tnlAssert( iSize > 0 && jSize > 0,
               cerr << "iSize = " << iSize
                    << "jSize = " << jSize );
 
diff --git a/src/implementation/core/tnlMultiArray3D_impl.h b/src/implementation/core/tnlMultiArray3D_impl.h
index a2f84d579ec245fe73dd410f049d033f47401ae9..f26325348f028334d18b8ee12531c3e423ec2845 100644
--- a/src/implementation/core/tnlMultiArray3D_impl.h
+++ b/src/implementation/core/tnlMultiArray3D_impl.h
@@ -106,8 +106,8 @@ Index tnlMultiArray< 3, Element, Device, Index > :: getElementIndex( const Index
                                                                      const Index i ) const
 {
    tnlAssert( i >= 0 && i < this -> dimensions[ 0 ] &&
-              j >= 0 && j < this -> dimensions[ 1 ] &&,
-              k >= 0 && k < this -> dimensions[ 2 ]
+              j >= 0 && j < this -> dimensions[ 1 ] &&
+              k >= 0 && k < this -> dimensions[ 2 ],
               cerr << " i = " << i
                    << " j = " << j
                    << " k = " << k
diff --git a/src/implementation/core/tnlMultiArray4D_impl.h b/src/implementation/core/tnlMultiArray4D_impl.h
index d1998d4ea752f9dcaaca8778fc41e0afea596c59..335853ca9d5c91871f0696db3ed99a425673848d 100644
--- a/src/implementation/core/tnlMultiArray4D_impl.h
+++ b/src/implementation/core/tnlMultiArray4D_impl.h
@@ -114,9 +114,9 @@ Index tnlMultiArray< 4, Element, Device, Index > :: getElementIndex( const Index
                                                                           const Index i ) const
 {
    tnlAssert( i >= 0 && i < this -> dimensions[ 0 ] &&
-              j >= 0 && j < this -> dimensions[ 1 ] &&,
+              j >= 0 && j < this -> dimensions[ 1 ] &&
               k >= 0 && k < this -> dimensions[ 2 ] &&
-              l >= 0 && l < this -> dimensions[ 3 ]
+              l >= 0 && l < this -> dimensions[ 3 ],
               cerr << " i = " << i
                    << " j = " << j
                    << " k = " << k
diff --git a/src/matrix/tnlMultiDiagonalMatrix.h b/src/matrix/tnlMultiDiagonalMatrix.h
index b9844b99f9749265531de4dc43273f9908062ec9..5b6364a08345bcaf57ec1786e4a826608b3d5084 100644
--- a/src/matrix/tnlMultiDiagonalMatrix.h
+++ b/src/matrix/tnlMultiDiagonalMatrix.h
@@ -195,7 +195,7 @@ Index tnlMultiDiagonalMatrix< Real, Device, Index > :: getNonzeroElements() cons
 template< typename Real, typename Device, typename Index >
 void tnlMultiDiagonalMatrix< Real, Device, Index > :: setDiagonalsOffsets( const tnlVector< Index, Device, Index >& diagonalsOffsets )
 {
-   tnlAssert( diagonalsOffsets. getSize() == this -> diagonalsOffsest. getSize(),
+   tnlAssert( diagonalsOffsets. getSize() == this -> diagonalsOffsets. getSize(),
               cerr << "diagonalsOffsets. getSize() = " << diagonalsOffsets. getSize()
                    << " this -> diagonalsOffsets. getSize() = " << this -> diagonalsOffsets. getSize() << endl; );
    this -> diagonalsOffsets = diagonalsOffsets;