Fixed some commands related bugs.