add check for message fields when determining message type

This addresses #376 - or at least the feasible part of it.

@esteve @tfoote @wjwwood Please provide feedback.