Some tweaks for html mode