Reorganize CLI tests; fix CLI tests