Fixed handling of pages in PagerAdapter.