Made next/last work as expected