Further work on next/prev handling.