changed interface for sending message and test enhancements.