Fix jshint errors and deprecation warning