CLI fixes and cleanup