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.
Merge pull request #31 from miska/master

Problem: Can't publish messages with mshell