Fix some errors for scalar outer_fold with tbb/openmp