Bugfix: fix several small pagination bugs (Thanks Tucos)