fix bug that causes \extendmargin to affect all pages

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