Fixed some of the strange behavior of pipes.  Added debug messages...