added communication error trapping, fixed up tests
added communication error trapping, fixed up tests