Fix config values not saving properly under certain conditions