small bug fixes to ctl test cmd code