WR.
Fix for inverting empty algs.
Restore missing tags in the header.

These were taken out in 39b967d624cb0fb8c6c130b92c0787073060bf88, probably by an accidental replace.
Fix closing tag and rename directive for better HTML5 conformance.

Note that <!DOCTYPE html> still causes layout issues.