diff --git a/sPuReMD/src/lin_alg.c b/sPuReMD/src/lin_alg.c
index 5ddead00bce98056396a449517ff507b719055de..23eed875768a5e4a40d6c527d955d66759e25d30 100644
--- a/sPuReMD/src/lin_alg.c
+++ b/sPuReMD/src/lin_alg.c
@@ -308,7 +308,11 @@ void setup_sparse_approx_inverse( const sparse_matrix * const A, sparse_matrix *
 
     for( i = left; i <= right ; ++i )
     {
-        list[i] = abs( A->val[i] );
+        list[i] = A->val[i];
+        if(list[i] < 0.0)
+        {
+            list[i] = -list[i];
+        }
     }
 
     turn = 0;
@@ -362,6 +366,11 @@ void setup_sparse_approx_inverse( const sparse_matrix * const A, sparse_matrix *
         }
     }
 
+    if(threshold < 1.000000)
+    {
+        threshold = 1.000001;
+    }
+
     sfree( list, "setup_sparse_approx_inverse::list" );
 
     /* fill sparsity pattern */
@@ -382,7 +391,6 @@ void setup_sparse_approx_inverse( const sparse_matrix * const A, sparse_matrix *
     }
     (*A_spar_patt)->start[A->n] = size;
 
-
     compute_full_sparse_matrix( A, A_full );
     compute_full_sparse_matrix( *A_spar_patt, A_spar_patt_full );