more fixes to next/prev