Misc Bugfixes for xml/json convert.