Fixed #23875 -- cleaned up query.get_count()
Improvements based on carljm's review