Accept TO in any case for use with n-ary functions. Fixes bug #18923.