Fix cli bugs introduced in last cli bug fixing fix