Fix output overbuffering and not being passed to pipe