Fix params restore bug and basic invalid value support