domain: Fix Select.count() on tables with inheritance.