Fixed some sigpipe crashes