Fixed SIGPIPE errors