Move the directory changing wizardry before it reads the config file, so that it still works.