Fix history pagination