Properly handle functions with arity==0