Rework config file writing.