Fixed some bugs in the Command Manager