Fixes to the pagination