Pagination view code and bug fixes
Pagination code tweaks and fixes