Updates to the minion code to make the XML more robust