Fixes to attach() on pipes.