Updated gen_dh_params to be really POSIX sh compliant