Fix 'page 4 of 3'-issue by respecting last page