Some minor changes to the command, bug fixing.