Fix pagination.  Still needs a lot of tweaking.