Redid network error checking

Untested
packets not parsed correctly yet (?)