Fixed pagination (fixes #3)