Bug fixes for cli