There are too many layers of defaults here.  Set these once when loading the environment variables, then assume that they're set everywhere else.