fixed some bugs related to xhtml.