Fix task history pagination