Fix switching environments from config file