some fixes for html head/tail stuff