Correct bugs in previous and next links