Fixed #22294 -- Prevented converting length filter output to string

Thanks Steve Pike for the report.