CRM-12638, prev/next optimization issues