Fixed config saving and value setting. Probably fixes #798

Currently saving config file or setting value causes NPE.
There's a simple fix that i provided in this PR.