Fix crash with the previous bugfix when there were less result than the per_page argument.