Fix chrome compatibility and jshint errors