Fix bug in command generator.