Fixed issue when writing config sections