DbPager detects subqueries (fixes #83). Fix tests.