Fix Socket NameError

Sorry, I don't know if this is the right way to fix this, but it worked for me. Part fixes #165.