* Backport doctype-tolerant fixes