Numerous fixes to ensure well-formedness of all pages