Fix to get replacements in > 1000 or so pages to work

Only the first 1000 or so pages will get replaced, but it's much better
than nothing...
Patch from Simon Bachenberg.

Change-Id: I12a7c3893c953befbc0a1b2306240d1d06c892f3