Fix syntax errors to JShint standards