Add some better error reporting and debug messages

I spent a good part of today tearing apart my code because I couldn't see the send/recv debug data. This should make troubleshooting in the future much easier.