Fixed bugs in the handling of page geometry.

* Fixed typos that meant some lengths were not set, and the wrong ones
were read.
* Geometry is now switched at shipout so as not to disturb the first
page.
* Marginal notes no longer overhang the page edge.
* The FixTextheight routine no longer disturbs placement of the footer.
* Removed workarounds that somehow made the previous code work.