Bug in #to_html_document