Fixing bugs in the xml parser