Fix unit tests
Disarm socket behavior in case of errors