Fixed usage of document.write/console.log.