Handle xhtml format correctly.
Update history.
Fix tests.
Remove temp dir if convert fails.