Buffer underrun bugfix

Note: Depends on PR #32.

Fixes a bug where the messageSize (from the payload) is being compared against the size of the message set, rather than the size of the message.