Fix pagination issue in history

Fixes Issue #1572