Fix #3049, set $config as global to it can be read