#12 Added proper error when couldn't write the configuration file.