Added diagnostic logging to the switch() for message processing.  Cleaned up {code:2}
Fixed {code:3} and {code:4} validation.