Fixes truncation on piped writes