Improved tests to handle network failures better.