Application.nargs should be a tuple in all cases (issue 3741)
Canonicalize nargs (to be a tuple) in Function class
Implement some suggestions on PR#2201