Adding more fixes to prevent broken pipes