Fixed more bugs in paging