Added: functionality to handle error packets 4 and 5, both in receiving
and sending.