Make CLI tests more reliable