Corrected console.log calls to window.console.log.