Add more tests for the CLI; issue #162