Be very cautious about global access to console. Fixes #838