Fixed pagination bug for rows_per_page == 1