Relaxed doctype validation

Fixes #460