Fixed few little bugs with invalid calculating from and to in pagination.