Made the search more robust to wring pagination sizes.