fixed server bug which caused messages to be lost when sent quickly.
Merge origin/master