Fix broken paging

Fixes #326