Fix for directory creation

Recent commits broke our ability to override the directory setting for each enviroment. This pull-request is for fixing that.