Added support for multiple Message Formats and minor fixes