"error calling Paginate: cannot convert type page.PagesGroup to Pages"

As I said, the only explanation I have for the above error (and the bug in the code, which I have fixed, is pretty obvious when I look at it now) is that .Paginate is called with an empty page.PagesGroup.