Fix pagination when there were as many elems as pagesize