Major update to CLI class with namespace issue and logic corrected.