Fix issue #505: DIET: doctype is actually ignored
Fix issue 510