added fixes to cli and misc fixes