Bug fixes in tco_pipe.cpp