Generalize argument ordering and fix 0-arg for functor case.
Test with real queries and various parameter ordering.