Fix bug in pagination (was unresolved)