Update and cleanup the config.