Fix and improve CLI