bug fix: empty nextUrl if no next/prev

Fixes a bug introduced in the previous commits.
Now testing a case where no lastUrl is returned.
Also fixing a regression where nextUrl wasn't erased properly.