Better handling of errors in console.