fixes/improvements
fixed typo
stability issues fixed by adding SIGPIPE signal handler