Fixing pagings.

Moving the paging block into the index block.