bugfixes

added logic to stop program from erroniously writing an empty config
file.