increased robustness for  calculating gmin in generate_ndpp_distrib_.  Should avoid some seg faults i have been seeing.