Fixed wrong message length when receiving a packet.