Fixed, refactored pagination.