Fixes a couple of XML parser bugs.