Grab byte from buffer before checking for header.
Check that entire packet has conceivably arrived before pulling.
Swap order of type and message.