Fix Syntax error and jshint warnings