Added a flag to disable console printing.