Fix random_sat, all_sat and exist_sat