Fixed two bugs and added a retry for http errors

nodes is a list so the cleanup needed to delete all of them. "list" didn't work with the == instead of in.
I also added a try except to handle issues that seemed to be happening because of talking through the proxy.