fix #5;wrong short parse for payloadlength
(cherry picked from commit 85e91e6)