Fixed #23875 -- cleaned up query.get_count()