Fix bugs related to front matter pagination and double sided output.