Better fix for #4240

This fix avoid only the setting of non-existing parameters while keeping
the previous behaviour intact.