Fixed TCP library pipes issue. Still problem with sigpipe :(