Added a command id field and explicit handling for repeated commands