Protect against missing console in some environments