More XML bugfixing