fixed compile errors with Func_max and Dist_MPEST