Some fixes to writing XML file for configurations.