Fix counting of arguments of closures

Do not rely on MFA name for the arity of functions, since closures have
an extra argument. Instead, just use the length of the arguments list.