fixed some problems on list command, added more tests