Fix for erroneous <html></html> that appeared

i also fixed the double <Document> but i forget if it's in this commit
or already committed