Fixed broken tests and broken cli code;