Properly handle socket open errors.  Closes #40