Fixed up the code to handle the enum COMMAND_TYPE