Pull request for 1.6 branch for the loop pagination bug