removing bugs valgrind xml parsing