Fix compatibility with Internet Explorer 8

Fix compatibility with Internet Explorer 8 which can't always call console.log() and console.error().