Fixed bug in msg param count check.