Pagination fix.

Fixed error on next and previous links.