Misc fixes, new unit testing for xhtml_substr