Fixed config saving and value setting. Probably fixes #798