fix bug that causes \extendmargin to affect all pages

Fix bug that causes \extendmargin to affect all pages. Fixes #2.
Fix is based on comments from gilgamec (see issue #2).