Bugfix document pagination.