Improved stream class filtering so it matches on subclasses too