Fix and test CLI