Do not iterate over functions. Fixes #12665. Unit tests added. Thanks to @kselden for finding the bug.
Attach a file by drag & drop or click to upload