Fix syntax error and jslint globals