Fix some pathname issues in cli.js.