diff -uNrd csircd-1.14.dist/include/misc.h csircd-1.14/include/misc.h
--- csircd-1.14.dist/include/misc.h	Sat Jun  7 11:25:23 2003
+++ csircd-1.14/include/misc.h	Sat Jun  7 11:45:05 2003
@@ -23,6 +23,7 @@
 int ircd_ratelimit(IRCD_CLIENT *pptr, int *numptr, int *timeptr, int numlimit, int timelimit);
 void servlink_rotate(SERVLINK *s);
 void command_tree_free(void);
+void command_tree_list(IRCD_CLIENT *pptr);
 void stringlist_add(IRCD_STRINGLIST **stlist, char *string);
 void stringlist_del(IRCD_STRINGLIST **stlist, IRCD_STRINGLIST *sptr);
 IRCD_STRINGLIST *stringlist_find(IRCD_STRINGLIST *stlist, char *string);
diff -uNrd csircd-1.14.dist/lib/commands.c csircd-1.14/lib/commands.c
--- csircd-1.14.dist/lib/commands.c	Sat Jun  7 11:25:22 2003
+++ csircd-1.14/lib/commands.c	Sat Jun  7 11:44:15 2003
@@ -4269,6 +4269,10 @@
 			}
 
 			break;
+		case 'M':
+		case 'm':
+			command_tree_list(pptr);
+			break;
 		case 'O':
 		case 'o':
 			for(oline=_ircd_conf.olines;oline;oline=oline->next)
diff -uNrd csircd-1.14.dist/lib/misc.c csircd-1.14/lib/misc.c
--- csircd-1.14.dist/lib/misc.c	Sat Jun  7 11:25:22 2003
+++ csircd-1.14/lib/misc.c	Sat Jun  7 11:50:22 2003
@@ -32,6 +32,7 @@
 {
 	char			*command;
 	commandfunc_t	function;
+	unsigned int count;
 };
 
 typedef struct _commandentry	COMMANDENTRY;
@@ -45,66 +46,66 @@
 static COMMANDENTRY *_commandtree[27];
 static COMMAND	_Commands[] =
 {
-	{	"SET",		m_set		},
-	{	"PRIVMSG",	m_privmsg	},
-	{	"WHO",		m_who		},
-	{	"WHOIS",	m_whois		},
-	{	"WHOWAS",	m_whowas	},
-	{	"USER",		m_user		},
-	{	"NICK",		m_nick		},
-	{	"SERVER",	m_server	},
-	{	"LIST",		m_list		},
-	{	"TOPIC",	m_topic		},
-	{	"INVITE",	m_invite	},
-	{	"VERSION",	m_version	},
-	{	"QUIT",		m_quit		},
-	{	"SQUIT",	m_squit		},
-	{	"KILL",		m_kill		},
-	{	"INFO",		m_info		},
-	{	"LINKS",	m_links		},
-	{	"STATS",	m_stats		},
-	{	"HELP",		m_help		},
-	{	"ERROR",	m_error		},
-	{	"AWAY",		m_away		},
-	{	"CONNECT",	m_connect	},
-	{	"PING",		m_ping		},
-	{	"PONG",		m_pong		},
-	{	"OPER",		m_oper		},
-	{	"PASS",		m_pass		},
-	{	"WALLOPS",	m_wallops	},
-	{	"TIME",		m_time		},
-	{	"NAMES",	m_names		},
-	{	"ADMIN",	m_admin		},
-	{	"TRACE",	m_trace		},
-	{	"NOTICE",	m_notice	},
-	{	"JOIN",		m_join		},
-	{	"PART",		m_part		},
-	{	"LUSERS",	m_lusers	},
-	{	"MOTD",		m_motd		},
-	{	"MODE",		m_mode		},
-	{	"KICK",		m_kick		},
-	{	"USERHOST",	m_userhost	},
-	{	"ISON",		m_ison		},
-	{	"NOTE",		m_note		},
-	{	"REHASH",	m_rehash	},
-	{	"RESTART",	m_restart	},
-	{	"CLOSE",	m_close		},
-	{	"SVINFO",	m_svinfo	},
-	{	"SJOIN",	m_sjoin		},
-	{	"DIE",		m_die		},
-	{	"DNS",		m_dns		},
-	{	"GLINE",	m_gline		},
-	{	"ENCAP",	m_encap		},
-	{	"OPERWALL",	m_operwall	},
-	{	"KLINE",	m_kline		},
-	{	"QUEUE",	m_queue		},
-	{	"FLAGS",	m_flags		},
-	{	"IPHASH",	m_iphash	},
-	{	"CAPAB",	m_capab		},
-	{	"REJECTHOLD",	m_rejecthold	},
-	{	"LOCOPS",	m_locops	},
-	{	"UNKLINE",	m_unkline	},
-	{	NULL,		NULL		}
+	{	"SET",		m_set,		0	},
+	{	"PRIVMSG",	m_privmsg,	0	},
+	{	"WHO",		m_who,		0	},
+	{	"WHOIS",	m_whois,	0	},
+	{	"WHOWAS",	m_whowas,	0	},
+	{	"USER",		m_user,		0	},
+	{	"NICK",		m_nick,		0	},
+	{	"SERVER",	m_server,	0	},
+	{	"LIST",		m_list,		0	},
+	{	"TOPIC",	m_topic,	0	},
+	{	"INVITE",	m_invite,	0	},
+	{	"VERSION",	m_version,	0	},
+	{	"QUIT",		m_quit,		0	},
+	{	"SQUIT",	m_squit,	0	},
+	{	"KILL",		m_kill,		0	},
+	{	"INFO",		m_info,		0	},
+	{	"LINKS",	m_links,	0	},
+	{	"STATS",	m_stats,	0	},
+	{	"HELP",		m_help,		0	},
+	{	"ERROR",	m_error,	0	},
+	{	"AWAY",		m_away,		0	},
+	{	"CONNECT",	m_connect,	0	},
+	{	"PING",		m_ping,		0	},
+	{	"PONG",		m_pong,		0	},
+	{	"OPER",		m_oper,		0	},
+	{	"PASS",		m_pass,		0	},
+	{	"WALLOPS",	m_wallops,	0	},
+	{	"TIME",		m_time,		0	},
+	{	"NAMES",	m_names,	0	},
+	{	"ADMIN",	m_admin,	0	},
+	{	"TRACE",	m_trace,	0	},
+	{	"NOTICE",	m_notice,	0	},
+	{	"JOIN",		m_join,		0	},
+	{	"PART",		m_part,		0	},
+	{	"LUSERS",	m_lusers,	0	},
+	{	"MOTD",		m_motd,		0	},
+	{	"MODE",		m_mode,		0	},
+	{	"KICK",		m_kick,		0	},
+	{	"USERHOST",	m_userhost,	0	},
+	{	"ISON",		m_ison,		0	},
+	{	"NOTE",		m_note,		0	},
+	{	"REHASH",	m_rehash,	0	},
+	{	"RESTART",	m_restart,	0	},
+	{	"CLOSE",	m_close,	0	},
+	{	"SVINFO",	m_svinfo,	0	},
+	{	"SJOIN",	m_sjoin,	0	},
+	{	"DIE",		m_die,		0	},
+	{	"DNS",		m_dns,		0	},
+	{	"GLINE",	m_gline,	0	},
+	{	"ENCAP",	m_encap,	0	},
+	{	"OPERWALL",	m_operwall,	0	},
+	{	"KLINE",	m_kline,	0	},
+	{	"QUEUE",	m_queue,	0	},
+	{	"FLAGS",	m_flags,	0	},
+	{	"IPHASH",	m_iphash,	0	},
+	{	"CAPAB",	m_capab,	0	},
+	{	"REJECTHOLD",	m_rejecthold,	0	},
+	{	"LOCOPS",	m_locops,	0	},
+	{	"UNKLINE",	m_unkline,	0	},
+	{	NULL,		NULL,		0	}
 };
 
 static void _command_tree_add(char *name, COMMAND *cptr);
@@ -212,6 +213,18 @@
 		_command_tree_add(cptr->command, cptr);
 }
 
+void command_tree_list(IRCD_CLIENT *pptr)
+{
+	int	i;
+
+	for(i=0; _Commands[i].command != NULL; i++)
+	{
+		send_prefix_to_client(meptr, pptr,
+			IRCD_REPLY(RPL_STATSCOMMANDS, pptr->name),
+			_Commands[i].command, _Commands[i].count);
+	}
+}
+
 int ircd_open_fd(int fd, int flags, IRCD_CONN *ptr, FDLIST *fdlistptr)
 {
 	FDLISTINFO	*fdlistinfo;
@@ -1143,7 +1156,10 @@
 		if (!from)
 			from = cptr;
 		if (mptr)
+		{
 			ret = mptr->function(cptr, from, sender, ptr);
+			mptr->count++;
+		}
 		else if (numeric && IsServer(cptr))
 		{
 	       /* numeric */
diff -uNrd csircd-1.14.dist/lib/numeric.c csircd-1.14/lib/numeric.c
--- csircd-1.14.dist/lib/numeric.c	Sat Jun  7 11:25:22 2003
+++ csircd-1.14/lib/numeric.c	Sat Jun  7 11:49:40 2003
@@ -62,7 +62,7 @@
 /* 209 */	{	RPL_TRACECLASS,			"Class %s %d" },
 /* 210 */	{	0,						(char *)NULL },
 /* 211 */	{	RPL_STATSLINKINFO,		(char *)NULL },
-/* 212 */	{	RPL_STATSCOMMANDS,		"%s %u %u" },
+/* 212 */	{	RPL_STATSCOMMANDS,		"%s %u" },
 /* 213 */	{	RPL_STATSCLINE,			"%c %s@%s * %s %d %s %s" },
 /* 214 */	{	RPL_STATSNLINE,			"%c %s@%s * %s %d %s %s" },
 /* 215 */	{	RPL_STATSILINE,			"%c %s * %s %d %s" },
