Changed cmd() to return a list.