Fix a bug relating to command dispatching