fix bugs in command creator.