       } else {
         if (args == NULL) {
           if (optional) value = nil; 
-          else error2(fname, PSTR("has too few arguments"));
+          else {
+            if (name) error2(name, PSTR("has too few arguments"));
+            else error2(0, PSTR("function has too few arguments"));
+          }
         } else { value = first(args); args = cdr(args); }
       }
       push(cons(var,value), *env);


object *fn_pinmode (object *args, object *env) {
  (void) env;
  int pin = integer(first(args));
  int pm = INPUT;
  object *mode = second(args);
  if (integerp(mode)) {
    int nmode = integer(mode);
    if (nmode == 1) pm = OUTPUT; else if (nmode == 2) pm = INPUT_PULLUP;
    #if defined(INPUT_PULLDOWN)
    else if (nmode == 4) pm = INPUT_PULLDOWN;

      item = cons(symbol(QUOTE), cons(read(gfun), NULL));
    } else if (item == (object *)DOT) {
      tail->cdr = read(gfun);
      if (readrest(gfun) != NULL) error2(0, PSTR("malformed list"));
      return head;
    } else {
      object *cell = cons(item, NULL);
