added error test cases, fixed error handling on rx
tidied up arp layer code