Using STDOUT only if defined. Closes 846