Improve hijacking of STDOUT