correctly handle refinement in safe delete of parameters