Fixed the Pagination bugs.