Fixes error reporting

The error function wasn't declared correctly. This triggered an error when two Highcharts versions were included in the same page.