Fixed up error handling for stratum socket