Changed the try/catch to an if/end.

Changed the try/catch introduced to support messages without fields to an if/end
block as per tanmaykm's suggestion.
Added test messages for messages without fields