Fixing bug in non openmp code