Use nice-pipe instead of own code.