Fixed some Bugs in XMLHandler