Fix prev/next navigation bug.