Fix the remaining bugs to close issue #2.
Notably XML Crashing.