fromHTML fixes kindly suggested by @mcurland