ParamSet: memory leak/corruption fix