beefed up Socket -- warning: untested commit! --