Fixed some HTML editor bugs