Revert to piping back to tempfiles to work around unreliable piping