Converted message type enum from outer to inner class
Added exception, parameter count testing