Fix most validation errors.

Note: Adding the <!DOCTYPE html> tag breaks things. Still need to debug.