Fixed error printing for BSD sockets