def fix_saes_params(solver, t, sds, default_sd=None):
    """
    Repair the strategy parameters (specifically for SAES)

    :param solver:          Solver used to start the optimisation
    :param t:               Trace containing solution
    :param sds:             Strategy parameters (standard deviations)
    :param default_sd:      Default mutation strength
    :return:
    """
    if default_sd is None:
        default_sd = solver.alg_params.mutation_sd
    # t = trace.trace
    sds = sds

    if len(t) < len(sds):
        sds = sds[:len(t)]
    elif len(t) > len(sds):
        for _ in t[len(sds):]:
            sds.append(default_sd)
    assert len(t) == len(sds)
    return sds