Fixed bug where event loop would stop when a packet with length zero was received