Fix aggregate query functions for page up/down