Fixed crash when console is undefined.