Added better error management for tests
Added the CLI tests