Some pagination bug fixes