more bug fixes in CLI