Problem: Can't publish messages with mshell

Actually mshell crashes while trying to send the message.

Solution: Fix off-by-one error causing the crash.