cli and bug fixes