Fix XML parsing exceptions