SIGPIPE signal handler added. Fixes #1