Fixed a bug in document.Command.