Fixed crash when recieving an invalid packet