Fix two issues of user key map for extension commands.

This fixes #9954 and #9953.
This needs a JSDoc comment something like:

```js
    /**
     * @private
     * Forward declaration for JSLint.
     * @type {Function}
     */
```