Fix bug in adding extra dummy SELECT for paging scans.