Fixed some bugs with commands