Fix some minor bugs in the html helper