Fixed CommandMessageStats.

Maybe. I don't actually know SQL, but I think this is right. If it
works, then this fixes issue #27.