bug fixesin Utilities.cpp and one part for seg_method2