Any raw invocations of mdep("env",...) should be replace with a utility function getenv() that checks for the undefined value and returns "".