Fixed some bugs shown by Scrutinizer

Ref:
https://scrutinizer-ci.com/g/royopa/HighchartsPHP/