[lib] Fix jshint issues.

- Fix missing vars, missing args, and conflicting names.