Fix XHTML errors and some testing issues