add number of message to stats output, and fix division by 0