Implemented PagerAdapter correctly. Fixes #301