Improve next.cpp.