Fixed error writing XML file when certain applications don't exist