Bug fixes for paging