Prevent console errors in IE9

Using console.log will prevent JS from working in IE9 until dev tools
is open. This fixes it.