Fix bugs in Prev/Next