Fix the SimpleDB pagination infinite loop from the original code.