Buffer underrun bugfix

Note: Depends on PR #30.

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.