Added net-error action, and refactored tests a bit