Improved handling of special characters in message contents. Other small changes.