Made config file more robust, thanks to bdew