Switched to console.error for error reporting.