Added simple implementation of WriteMessage().