whitespace cleanup and EPIPE handling