Chase down some typespecs, logfile => log_to_file, add missing {log,N} debug option