fix superbug that creates an infinite loop when parsing a message
fix bug that returned null if a message had 0 payload