Added flush calls to ensure Console output is shown - may not be
desireable in case we're dealing with a file.