Improved test coverage and a small bug fix for CLI routes.