"Fixed invalid variable ref in socket error handling"