Added ability to enable/disable error display and logging