(maint) Fix error message in reduce function

If you had 3 parameters this error message would print the type of the
wrong parameter.