Fix bug in setting html mode