pipe write fixes