Correctly calculate number of topics for filtered Metadata requests

Reported by Steven Le Roux