Added toString(MessageType) to improve error messages.